def test_invalid_characters(self): invalid_chars = [ '+', '-', '$', '%', '^', '&', '*', '(', ')', '!', '@', '#', '<', '>', '?', '/', '\\', '[', ']', '{', '}', '=' ] for char in invalid_chars: with self.assertRaises(ValueError): color('aqua{0}marine'.format(char))
def test_color_with_space(self): self.assertEqual({'color': 'aqua marine'}, color('aqua marine'), 'Expect color with space to be returned')
def test_color_with_camelcase(self): self.assertEqual({'color': 'BluE'}, color('BluE'), 'Expect color with camelcase letters to be returned') self.assertEqual({'color': 'bluE'}, color('bluE'), 'Expect color with camelcase letters to be returned')
def test_color_with_all_uppercase(self): self.assertEqual( {'color': 'BLUE'}, color('BLUE'), 'Expect color with all uppercase letters to be returned')
def test_color_with_all_lowercase(self): self.assertEqual( {'color': 'blue'}, color('blue'), 'Expect color with all lowercase letters to be returned')
def test_color_with_capitalize_letter(self): self.assertEqual({'color': 'Blue'}, color('Blue'), 'Expect color with capitalize word to be returned')