def test_is_upper(self): ptr = [ ('c', False), ('C', True), ('hello I AM DONALD', False), ('HELLO I AM DONALD', True), ] for inp, exp in ptr: with self.subTest(inp=inp, exp=exp): self.assertEqual(is_uppercase(inp=inp), exp)
def test_is_uppercase_all_uppercase(self): string = is_uppercase('ABCDEF') self.assertTrue(string)
def test_is_uppercase_empty_string(self): string = is_uppercase('') self.assertTrue(string)
def test_is_uppercase_no_alphabet(self): string = is_uppercase("!@#$%^&*()_+123456778") self.assertTrue(string)
def test_is_uppercase_mixed_character_hidden(self): string = is_uppercase("HeLLO !@#$%^&* I LOVe FooD tOO.") self.assertFalse(string)
def test_is_uppercase_mixed_character(self): string = is_uppercase("HELLO, MY NAME IS !@#$%^&* AND I LOVE FOOD.") self.assertTrue(string)
def test_is_uppercase_mixed_uppercase_lowercase(self): string = is_uppercase('aBCDef') self.assertFalse(string)
def test_is_uppercase_all_lowercase(self): string = is_uppercase('abcdef') self.assertFalse(string)