Пример #1
0
 def test_remove_multiple_arguments(self):
     hn = HumanName("Ms Hon Solo", constants=None)
     hn.C.titles.remove("hon", "ms")
     hn.parse_full_name()
     assert hn.first == "Ms"
     assert hn.middle == "Hon"
     assert hn.last == "Solo"
Пример #2
0
 def test_add_multiple_arguments(self):
     hn = HumanName("Assoc Dean of Chemistry Robert Johns", constants=None)
     hn.C.titles.add("dean", "Chemistry")
     hn.parse_full_name()
     assert hn.title == "Assoc Dean of Chemistry"
     assert hn.first == "Robert"
     assert hn.last == "Johns"
Пример #3
0
 def test_remove_title(self):
     hn = HumanName("Hon Solo", constants=None)
     start_len = len(hn.C.titles)
     assert start_len > 0
     hn.C.titles.remove("hon")
     assert start_len - 1 == len(hn.C.titles)
     hn.parse_full_name()
     assert hn.first == "Hon"
     assert hn.last == "Solo"
Пример #4
0
 def test_add_title(self):
     hn = HumanName("Te Awanui-a-Rangi Black", constants=None)
     start_len = len(hn.C.titles)
     assert start_len > 0
     hn.C.titles.add("te")
     assert start_len + 1 == len(hn.C.titles)
     hn.parse_full_name()
     assert hn.title == "Te"
     assert hn.first == "Awanui-a-Rangi"
     assert hn.last == "Black"