Skip to content

Commit

Permalink
test hardening
Browse files Browse the repository at this point in the history
  • Loading branch information
TAAPArthur committed Dec 13, 2023
1 parent 6676510 commit d69c18b
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions amt/tests/test.py
Original file line number Diff line number Diff line change
Expand Up @@ -247,6 +247,8 @@ def verfiy_media_list(self, media_list=None, server=None):
self.assertTrue(isinstance(media_data, MediaData), type(media_data))
self.verfiy_media_chapter_data(media_data)
assert "\n" not in media_data["name"]
assert media_data["name"]
assert media_data["id"]

if not server:
server = self.media_reader.get_server(media_list[0]["server_id"])
Expand Down Expand Up @@ -1747,12 +1749,12 @@ def test_load(self):

def test_load_resolve_media_type(self):
media_list = self.add_test_media(server_id=TestUnofficialServer.id)
self.assertFalse(any(media_data["media_type_name"] for media_data in media_list))
parse_args(media_reader=self.media_reader, args=["--auto", "load", "--local-only", "test_user"])
for media_data in media_list:
if self.media_reader.get_tracker_info(media_data):
self.assertTrue(media_data["media_type_name"])
self.assertTrue(MediaType(media_data["media_type"]).name)
self.assertEqual(MediaType(media_data["media_type"]).bit_count(), 1)

def test_load_filter_by_type(self):
parse_args(media_reader=self.media_reader, args=["--auto", "load", f"--media-type={MediaType.ANIME.name}", "test_user"])
Expand Down Expand Up @@ -2352,8 +2354,8 @@ class ServerStreamTest(RealBaseUnitTestClass):
("https://hidive.com/tv/o-maidens-in-your-savage-season", "o-maidens-in-your-savage-season"),
("https://j-novel.club/series/monster-tamer", "monster-tamer"),
("https://mangaplus.shueisha.co.jp/titles/100020", 100020),
("https://mangasee123.com/manga/Mairimashita-Iruma-kun", "Mairimashita-Iruma-kun"),
("https://mangasee123.com/manga/Gunslinger-Girl", "Gunslinger-Girl"),
("https://mangasee123.com/manga/Mairimashita-Iruma-kun", "Mairimashita-Iruma-kun"),
("https://nyaa.si/?f=0&c=1_2&q=%5BEMBER%5D+Watashi+no+Shiawase+na+Kekkon", "[EMBER] Watashi no Shiawase na Kekkon"),
("https://nyaa.si/view/1047104", "1047104"),
("https://nyaa.si/view/135283", "135283"),
Expand Down

0 comments on commit d69c18b

Please sign in to comment.