Beispiel #1
0
 def test_that_it_can_handle_a_similar_prefix_and_middle_initial(self):
     n = Namestring("Dr. Bob D. Parr")
     n._allocate()
     assert n.prefix == "Dr."
     assert n.fname == "Bob"
     assert n.mname == "D."
     assert n.lname == "Parr"
Beispiel #2
0
 def test_that_it_can_handle_two_name_lists(self):
     n = Namestring("Odysseus Ithaka")
     n.name_list2 = ["Penelope", "Ithaka"]
     n._allocate()
     assert n.fname == "Odysseus"
     assert n.mname is None
     assert n.lname == "Ithaka"
     assert n.fname2 == "Penelope"
     assert n.mname2 is None
     assert n.lname2 == "Ithaka"
Beispiel #3
0
 def test_that_it_can_handle_an_ampersand(self):
     n = Namestring("Bob and Helen Parr")
     n._allocate()
     assert n.fname == "Bob"
     assert n.mname is None
     assert n.lname == "Parr"
     assert n.fname2 == "Helen"
     assert n.mname2 is None
     assert n.lname2 == "Parr"
     assert n.to_list() == [
         None,
         "Bob",
         None,
         "Parr",
         None,
         None,
         "Helen",
         None,
         "Parr",
         None,
     ]
Beispiel #4
0
 def test_that_it_can_handle_three_names(self):
     n = Namestring("William Cyrus Jehosephat")
     n._allocate()
     assert n.fname == "William"
     assert n.mname == "Cyrus"
     assert n.lname == "Jehosephat"
Beispiel #5
0
 def test_that_it_can_handle_two_names(self):
     n = Namestring("Bob Smith")
     n._allocate()
     assert n.fname == "Bob"
     assert n.mname is None
     assert n.lname == "Smith"