def test_reject_bad_fullnames(self, fullname): raw = self.SIMPLE_CONTEXT.format('dummy') result = obfuscate_util.find_user_fullname(raw, fullname) self.assertEquals(raw, result) self.assertTrue(fullname in obfuscate_util.REJECTED_NAMES)
def test_skip_non_fullnames(self, text, fullname): raw = self.SIMPLE_CONTEXT.format(text) result = obfuscate_util.find_user_fullname(raw, fullname) self.assertEquals(raw, result)
def test_find_fullnames_in_context(self, text, fullname, result): raw = self.SIMPLE_CONTEXT.format(text) expected = self.SIMPLE_CONTEXT.format(result) actual = obfuscate_util.find_user_fullname(raw, fullname) self.assertEquals(expected, actual)
def test_find_simple_fullnames(self, text, fullname): raw = self.SIMPLE_CONTEXT.format(text) expected = self.SIMPLE_CONTEXT.format("<<FULLNAME>>") result = obfuscate_util.find_user_fullname(raw, fullname) self.assertEquals(expected, result)