@@ -46,7 +46,7 @@ def m(self, actual, expected, hn):
4646 self .assertEqual (actual , expected , "'%s' != '%s' for '%s'\n %r" % (
4747 actual ,
4848 expected ,
49- hn .full_name ,
49+ hn .original ,
5050 hn
5151 ))
5252 except UnicodeDecodeError :
@@ -1358,7 +1358,7 @@ def test_add_constant_with_explicit_encoding(self):
13581358 self .assertIn ('béck' , c .titles )
13591359
13601360
1361- class HumanNameNicknameTestCase (HumanNameTestBase ):
1361+ class NicknameTestCase (HumanNameTestBase ):
13621362 # https://code.google.com/p/python-nameparser/issues/detail?id=33
13631363 def test_nickname_in_parenthesis (self ):
13641364 hn = HumanName ("Benjamin (Ben) Franklin" )
@@ -1445,12 +1445,64 @@ def test_duplicate_parenthesis_are_removed_from_name(self):
14451445 self .m (hn .last , "Jones" , hn )
14461446 self .m (hn .suffix , "Jr." , hn )
14471447
1448- def test_parenthesis_and_quotes_together (self ):
1449- hn = HumanName ("Jennifer 'Jen' Jones (Duff)" )
1450- self .m (hn .first , "Jennifer " , hn )
1451- self .m (hn .last , "Jones " , hn )
1452- self .m (hn .nickname , "Jen Duff " , hn )
1448+ def test_nickname_and_last_name (self ):
1449+ hn = HumanName ('"Rick" Edmonds' )
1450+ self .m (hn .first , "" , hn )
1451+ self .m (hn .last , "Edmonds " , hn )
1452+ self .m (hn .nickname , "Rick " , hn )
14531453
1454+ @unittest .expectedFailure
1455+ def test_nickname_and_last_name_with_title (self ):
1456+ hn = HumanName ('Senator "Rick" Edmonds' )
1457+ self .m (hn .title , "Senator" , hn )
1458+ self .m (hn .first , "" , hn )
1459+ self .m (hn .last , "Edmonds" , hn )
1460+ self .m (hn .nickname , "Rick" , hn )
1461+
1462+
1463+
1464+ # class MaidenNameTestCase(HumanNameTestBase):
1465+ #
1466+ # def test_parenthesis_and_quotes_together(self):
1467+ # hn = HumanName("Jennifer 'Jen' Jones (Duff)")
1468+ # self.m(hn.first, "Jennifer", hn)
1469+ # self.m(hn.last, "Jones", hn)
1470+ # self.m(hn.nickname, "Jen", hn)
1471+ # self.m(hn.maiden, "Duff", hn)
1472+ #
1473+ # def test_maiden_name_with_nee(self):
1474+ # # https://en.wiktionary.org/wiki/née
1475+ # hn = HumanName("Mary Toogood nee Johnson")
1476+ # self.m(hn.first, "Mary", hn)
1477+ # self.m(hn.last, "Toogood", hn)
1478+ # self.m(hn.maiden, "Johnson", hn)
1479+ #
1480+ # def test_maiden_name_with_accented_nee(self):
1481+ # # https://en.wiktionary.org/wiki/née
1482+ # hn = HumanName("Mary Toogood née Johnson")
1483+ # self.m(hn.first, "Mary", hn)
1484+ # self.m(hn.last, "Toogood", hn)
1485+ # self.m(hn.maiden, "Johnson", hn)
1486+ #
1487+ # def test_maiden_name_with_nee_and_comma(self):
1488+ # # https://en.wiktionary.org/wiki/née
1489+ # hn = HumanName("Mary Toogood, née Johnson")
1490+ # self.m(hn.first, "Mary", hn)
1491+ # self.m(hn.last, "Toogood", hn)
1492+ # self.m(hn.maiden, "Johnson", hn)
1493+ #
1494+ # def test_maiden_name_with_nee_with_parenthesis(self):
1495+ # hn = HumanName("Mary Toogood (nee Johnson)")
1496+ # self.m(hn.first, "Mary", hn)
1497+ # self.m(hn.last, "Toogood", hn)
1498+ # self.m(hn.maiden, "Johnson", hn)
1499+ #
1500+ # def test_maiden_name_with_parenthesis(self):
1501+ # hn = HumanName("Mary Toogood (Johnson)")
1502+ # self.m(hn.first, "Mary", hn)
1503+ # self.m(hn.last, "Toogood", hn)
1504+ # self.m(hn.maiden, "Johnson", hn)
1505+ #
14541506
14551507class PrefixesTestCase (HumanNameTestBase ):
14561508
0 commit comments