def test_last_name_camelcase(self): self.assertEqual( {'lastname': 'FoO'}, last_name('FoO'), 'Expect last name with camelcase letters to be returned') self.assertEqual( {'lastname': 'foO'}, last_name('foO'), 'Expect last name with camelcase letters to be returned')
def test_last_name_invalid_characters(self): invalid_chars = [ '+', '-', '$', '%', '^', '&', '*', '(', ')', '!', '@', '#', '<', '>', '?', '/', '\\', '[', ']', '{', '}', '=' ] for char in invalid_chars: with self.assertRaises(ValueError): last_name('test{0}lastname'.format(char))
def test_last_name_all_lowercase(self): self.assertEqual( {'lastname': 'foo'}, last_name('foo'), 'Expect last name with all lowercase letters to be returned')
def test_last_name_all_uppercase(self): self.assertEqual( {'lastname': 'FOO'}, last_name('FOO'), 'Expect last name with all uppercase letters to be returned')
def test_last_name_capitalize_letter(self): self.assertEqual( {'lastname': 'Foo'}, last_name('Foo'), 'Expect last name with capitalize word to be returned')