Exemple #1
0
#--coding:utf-8--

from name_function import get_full_name

print ("Enter 'q' at any time to quit.")
while True:
    first = raw_input("\nPlease give me a first name: ")
    if first == 'q':
        break
    last = raw_input("\nPlease gibe me a last name: ")
    if last == 'q':
        break

    formatted_name = get_full_name(first,last)
    print ("\tNeatly formatted name: " + formatted_name + '.')


Exemple #2
0
 def test_get_full_name_three(self):
     result = get_full_name('zhang', 'bin', 'wen')
     self.assertEqual(result, 'Zhang Wen Bin')
Exemple #3
0
 def test_first_last_name(self):
     """Do names like 'Janis Joplin' work?"""
     formatted_name = get_full_name('janis', 'joplin')
     # assert the expected value
     self.assertEqual(formatted_name, 'Janis Joplin')
Exemple #4
0
 def test_get_full_name(self):
     result = get_full_name('zhang', 'bin')
     self.assertEqual(result, 'Zhang Bin')
Exemple #5
0
 def test_first_last_middle_name(self):
     """Do names like 'Johnny Lee Hooker' work?"""
     formatted_name = get_full_name('johnny', 'hooker', 'lee')
     # assert the expected value
     self.assertEqual(formatted_name, 'Johnny Lee Hooker')