|
9 | 9 | FILE_HIGHSCORES_EXPERIENCE = "highscores/tibiacom_experience.txt" |
10 | 10 | FILE_HIGHSCORES_LOYALTY = "highscores/tibiacom_loyalty.txt" |
11 | 11 | FILE_HIGHSCORES_EMPTY = "highscores/tibiacom_empty.txt" |
| 12 | +FILE_HIGHSCORES_NO_RESULTS = "highscores/tibiacom_no_results.txt" |
12 | 13 |
|
13 | 14 | FILE_HIGHSCORES_TIBIADATA_FULL = "highscores/tibiadata_full.json" |
14 | 15 | FILE_HIGHSCORES_TIBIADATA_EXPERIENCE = "highscores/tibiadata_experience.json" |
@@ -79,12 +80,24 @@ def test_highscores_from_content_loyalty(self): |
79 | 80 | self.assertIsInstance(entry.title, str) |
80 | 81 |
|
81 | 82 | def test_highscores_from_content_empty(self): |
82 | | - """Testing parsing highscores empty highscores""" |
| 83 | + """Testing parsing highscores when empty (world doesn't exist)""" |
83 | 84 | content = self._load_resource(FILE_HIGHSCORES_EMPTY) |
84 | 85 | highscores = Highscores.from_content(content) |
85 | 86 |
|
86 | 87 | self.assertIsNone(highscores) |
87 | 88 |
|
| 89 | + def test_highscores_from_content_no_results(self): |
| 90 | + """Testing parsing highscores with no results (first day of a new world)""" |
| 91 | + content = self._load_resource(FILE_HIGHSCORES_NO_RESULTS) |
| 92 | + highscores = Highscores.from_content(content) |
| 93 | + |
| 94 | + self.assertIsInstance(highscores, Highscores) |
| 95 | + self.assertEqual(highscores.world, "Unica") |
| 96 | + self.assertEqual(highscores.category, Category.EXPERIENCE) |
| 97 | + self.assertEqual(highscores.vocation, VocationFilter.ALL) |
| 98 | + self.assertEqual(highscores.total_pages, 0) |
| 99 | + self.assertEqual(len(highscores.entries), 0) |
| 100 | + |
88 | 101 | def test_highscores_from_content_unrelated_section(self): |
89 | 102 | """Testing parsing an unrelated section""" |
90 | 103 | content = self._load_resource(self.FILE_UNRELATED_SECTION) |
|
0 commit comments