diff --git a/4-testing/17-assertions/test_string_utils.py b/4-testing/17-assertions/test_string_utils.py index c5e88eb..d946680 100644 --- a/4-testing/17-assertions/test_string_utils.py +++ b/4-testing/17-assertions/test_string_utils.py @@ -7,13 +7,27 @@ class TestStringUtils(unittest.TestCase): def test_reverse_string(self): + # Test cases for reversing a string self.assertEqual(reverse_string('mochi'), 'ihcom') - + self.assertEqual(reverse_string('hello'), 'olleh') + self.assertEqual(reverse_string('Python'), 'nohtyP') + self.assertEqual(reverse_string(''), '') # Empty string case + def test_capitalize_string(self): + # Test cases for capitalizing a string self.assertEqual(capitalize_string('mochi'), 'Mochi') + self.assertEqual(capitalize_string('hello'), 'Hello') + self.assertEqual(capitalize_string('python'), 'Python') + self.assertEqual(capitalize_string('hELLO'), 'Hello') # Should fix mixed case + self.assertEqual(capitalize_string(''), '') # Empty string case def test_is_capitalized(self): - self.assertTrue(is_capitalized('mochi')) + # Test cases for checking if the string is capitalized + self.assertTrue(is_capitalized('Mochi')) + self.assertFalse(is_capitalized('mochi')) # This case should return False + self.assertTrue(is_capitalized('Hello')) + self.assertFalse(is_capitalized('hello')) + self.assertFalse(is_capitalized('')) # Empty string should return False if __name__ == '__main__': unittest.main()