Skip to content

Commit

Permalink
Add tests for sanitizeSceneName and full_sanitizeSceneName (#8763)
Browse files Browse the repository at this point in the history
  • Loading branch information
offbyone authored Jun 3, 2024
1 parent 885d026 commit df6c48d
Showing 1 changed file with 22 additions and 7 deletions.
29 changes: 22 additions & 7 deletions tests/test_helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -587,19 +587,34 @@ def test_fix_set_group_id(self):
"""
pass

@unittest.skip("Not yet implemented")
def test_sanitize_scene_name(self):
"""
Test sanitizeSceneName
"""
pass
cases = [
{"name": "", "anime": False, "expected": ""},
{"name": "Name, with: bad (chars)!", "anime": False, "expected": "Name.with.bad.chars"},
{"name": "Rock & Roll", "anime": False, "expected": "Rock.and.Roll"},
{"name": "This is a-test", "anime": False, "expected": "This.is.a.test"},
{"name": "Trailing dot.", "anime": False, "expected": "Trailing.dot"},
{"name": "Kuroko's Basketball", "anime": True, "expected": "Kuroko's.Basketball"},
{"name": "Name with — unusual & characters…", "anime": False, "expected": "Name.with.—.unusual.and.characters"},
{"name": "Too....many....dots...", "anime": False, "expected": "Too.many.dots"},
{"name": "'Single' and “Double” quotes", "anime": False, "expected": "Single.and.“Double”.quotes"},
]

for case in cases:
with self.subTest(case=case):
self.assertEqual(helpers.sanitizeSceneName(case["name"], anime=case["anime"]), case["expected"])

@unittest.skip("Not yet implemented")
def test_full_sanitize_scene_name(self):
"""
Test full_sanitizeSceneName
"""
pass
cases = [
{"name": "Name, with: bad (chars)!", "expected": "name with bad chars"},
{"name": "a basic name", "expected": "a basic name"},
]
for case in cases:
with self.subTest(case=case):
self.assertEqual(helpers.full_sanitizeSceneName(case["name"]), case["expected"])

@unittest.skip("Not yet implemented")
def test_remove_article(self):
Expand Down

0 comments on commit df6c48d

Please sign in to comment.