|
3 | 3 | from fruit import capitalize_fruit_names
|
4 | 4 |
|
5 | 5 |
|
6 |
| -class TestAllFruits(unittest.TestCase): |
| 6 | +class TestFruit(unittest.TestCase): |
7 | 7 | def test_empty_list(self):
|
8 | 8 | """with empty list"""
|
9 | 9 | self.assertEqual(capitalize_fruit_names([]), [])
|
10 | 10 |
|
11 |
| - def test_lowercase_list(self): |
| 11 | + def test_lowercase(self): |
12 | 12 | """with lowercase strings"""
|
13 | 13 | self.assertEqual(
|
14 | 14 | capitalize_fruit_names(["apple", "banana", "cherry"]),
|
15 | 15 | ["Apple", "Banana", "Cherry"],
|
16 | 16 | )
|
17 | 17 |
|
18 |
| - def test_uppercase_list(self): |
| 18 | + def test_uppercase(self): |
19 | 19 | """with uppercase strings"""
|
20 | 20 | self.assertEqual(
|
21 | 21 | capitalize_fruit_names(["APPLE", "BANANA", "CHERRY"]),
|
22 | 22 | ["Apple", "Banana", "Cherry"],
|
23 | 23 | )
|
24 | 24 |
|
25 |
| - def test_mixed_case_list(self): |
| 25 | + def test_mixed_case(self): |
26 | 26 | """with mixed case strings"""
|
27 | 27 | self.assertEqual(
|
28 |
| - capitalize_fruit_names(["mAnGo", "grApE"]), ["Mango", "Grape"] |
| 28 | + capitalize_fruit_names(["mAnGo", "grApE"]), |
| 29 | + ["Mango", "Grape"], |
29 | 30 | )
|
30 | 31 |
|
31 | 32 | def test_non_string_element(self):
|
32 | 33 | """with a mix of integer and string elements"""
|
33 | 34 | self.assertEqual(
|
34 |
| - capitalize_fruit_names([123, "banana"]), ["", "Banana"] |
| 35 | + capitalize_fruit_names([123, "banana"]), |
| 36 | + ["", "Banana"], |
35 | 37 | )
|
36 | 38 |
|
37 | 39 |
|
|
0 commit comments