From 9a0917dbf6160092b6460f7ae57b63e7693f0e40 Mon Sep 17 00:00:00 2001 From: ThePromidius Date: Thu, 18 Jan 2024 14:46:33 +0100 Subject: [PATCH] updated test data --- .github/workflows/Run_Tests.yml | 5 ----- MangaTaggerLib/utils.py | 2 +- tests/data/BLEACH/data.json | 2 +- tests/data/Hurejasik/data.json | 2 +- tests/data/Naruto/data.json | 3 ++- tests/test_integration.py | 2 +- 6 files changed, 6 insertions(+), 10 deletions(-) diff --git a/.github/workflows/Run_Tests.yml b/.github/workflows/Run_Tests.yml index 884314e..20e78f1 100644 --- a/.github/workflows/Run_Tests.yml +++ b/.github/workflows/Run_Tests.yml @@ -1,7 +1,6 @@ name: Python tests on: - - push - pull_request jobs: @@ -20,9 +19,5 @@ jobs: python-version: ${{ matrix.python-version }} cache: 'pip' - run: pip install -r requirements.txt -# - run: sudo apt install xvfb -# - name: Start xvfb -# run: | -# Xvfb :99 -screen 0 1920x1080x24 &disown - name: Run the tests run: python3 -m unittest discover -s tests -t . diff --git a/MangaTaggerLib/utils.py b/MangaTaggerLib/utils.py index a68ebf7..218a310 100644 --- a/MangaTaggerLib/utils.py +++ b/MangaTaggerLib/utils.py @@ -464,7 +464,7 @@ def levenshtein_distance_no_numpy(s1, s2): else: distance[i][j] = min(distance[i - 1][j] + 1, distance[i][j - 1] + 1, distance[i - 1][j - 1] + 1) - return distance[rows - 1][cols - 1] + return distance def compare(s1, s2): s1 = s1.lower().strip('/[^a-zA-Z ]/g", ') s2 = s2.lower().strip('/[^a-zA-Z ]/g", ') diff --git a/tests/data/BLEACH/data.json b/tests/data/BLEACH/data.json index f35c1d5..9600511 100644 --- a/tests/data/BLEACH/data.json +++ b/tests/data/BLEACH/data.json @@ -1,7 +1,7 @@ { "id": 30012, "status": "FINISHED", - "synonyms": ["ブリーチ", "بلیچ", "سفید کننده"], + "synonyms": ["ブリーチ", "بلیچ", "سفید کننده","死神"], "volumes": 74, "siteUrl": "https://anilist.co/manga/30012", "title": { diff --git a/tests/data/Hurejasik/data.json b/tests/data/Hurejasik/data.json index 61207be..72b9b0b 100644 --- a/tests/data/Hurejasik/data.json +++ b/tests/data/Hurejasik/data.json @@ -1,7 +1,7 @@ { "id": 86964, "status": "FINISHED", - "synonyms": ["BASTARD", "不肖子", "Ублюдок", "Bâtard", "Bastardo", "バスタード"], + "synonyms": ["BASTARD", "不肖子", "Ублюдок", "Bâtard", "Bastardo", "バスタード", "Kopile"], "volumes": 5, "siteUrl": "https://anilist.co/manga/86964", "title": { diff --git a/tests/data/Naruto/data.json b/tests/data/Naruto/data.json index e5f6a4d..626b7d1 100644 --- a/tests/data/Naruto/data.json +++ b/tests/data/Naruto/data.json @@ -12,7 +12,8 @@ "type": "MANGA", "genres": [ "Action", - "Adventure" + "Adventure", + "Supernatural" ], "startDate": { "day": 21, diff --git a/tests/test_integration.py b/tests/test_integration.py index 1b0a37d..fae3942 100644 --- a/tests/test_integration.py +++ b/tests/test_integration.py @@ -115,7 +115,7 @@ def test_metadata_case_4(self): with open(Path(self.data_dir, title, self.data_file), encoding='utf-8') as data: anilist_details = json.load(data) - + self.MangaTaggerLib_AppSettings.adult_result = False expected_manga_metadata = Metadata(title, {}, anilist_details) actual_manga_metadata = metadata_tagger("NOWHERE", downloaded_title, '001', "MANGA", {}, None)