diff --git a/SNG_DEFAULTS.py b/SNG_DEFAULTS.py index 1e1010e..fef9a97 100644 --- a/SNG_DEFAULTS.py +++ b/SNG_DEFAULTS.py @@ -25,11 +25,11 @@ SngOptionalHeader = [ "ID", # ChurchTools ID - "OTitle", # TODO Title parts slides - e.g. FJ5/073 - "TitleLang2", # TODO Title parts slides - e.g. FJ5/073 + "OTitle", + "TitleLang2", "Translation", "Bible", # Checked with Psalms only - "RECHTE", # TODO check spelling + "Rights", ] SngIllegalHeader = [ diff --git a/SngFile.py b/SngFile.py index 7dc3d8e..1f7f6ce 100644 --- a/SngFile.py +++ b/SngFile.py @@ -217,9 +217,8 @@ def validate_headers(self) -> bool: and "Translation" not in self.header ): missing.append("Translation") - # TODO add test case for language validation - - # TODO add TitleLang2 validation + # TODO (bensteUEM): Add language validation + # https://github.com/bensteUEM/SongBeamerQS/issues/33 result = len(missing) == 0 @@ -334,7 +333,9 @@ def validate_header_songbook(self, fix: bool = False) -> bool: # sample is EG 548 & WWDLP 170 = loc 77 # -> no longer needed because of regex check - # TODO low Prio - check numeric range of songbooks + # TODO (bensteUEM): low Prio - check numeric range of songbooks + # https://github.com/bensteUEM/SongBeamerQS/issues/34 + # EG 1 - 851 incl.non numeric e.g. 178.14 # EG Psalms in EG Württemberg EG 701-758 # Syntax should be EG xxx - Psalm Y @@ -388,8 +389,11 @@ def validate_header_background(self, fix: bool = False) -> bool: logging.debug(error_message) return False - # TODO validate background against resolution list #29 - # TODO validate background against copyright available #30 + # TODO (bensteUEM): validate background against resolution list + # https://github.com/bensteUEM/SongBeamerQS/issues/29 + + # TODO (bensteUEM): validate background against copyright available + # https://github.com/bensteUEM/SongBeamerQS/issues/30 def fix_header_background(self) -> bool: """Helper which tries to fix background image information automatically. @@ -536,7 +540,10 @@ def generate_verses_from_unknown(self) -> dict | None: "Added new '%s' in Verse Order of (%s)", new_block_keys, self.filename ) self.content.pop("Unknown") - self.content.update(new_blocks) # TODO check what happens if already exists + self.content.update(new_blocks) + # TODO (bensteUEM): check what happens if already exists + # https://github.com/bensteUEM/SongBeamerQS/issues/35 + logging.info( "Replaced 'Unknown' with '%s' in Verse Order of (%s)", new_block_keys, diff --git a/main.py b/main.py index 6f7a19b..9353c86 100644 --- a/main.py +++ b/main.py @@ -603,13 +603,3 @@ def upload_local_songs_by_id(df_sng: pd.DataFrame, df_ct: pd.DataFrame) -> None: """ logging.info("Main Method finished") - - # TODO Ideensammlung - # Check for leere Folie mit Strophe 0 - bsp. EG 449 - # Psalm Auto Language Marking if space idented - - # Check Verses in numerical order - # Replace Vers and Strophe by Verse and Chorus by Refrain - - # validate_header_songbook(df, True) - # df.to_csv("Main_DF_Export.csv", quoting=csv.QUOTE_NONNUMERIC) diff --git a/ruff.toml b/ruff.toml index aa57fb9..205d29b 100644 --- a/ruff.toml +++ b/ruff.toml @@ -40,7 +40,6 @@ ignore = [ #ToDo Items "FIX", - "TD", ] extend-ignore = [] #Skip rules that need more code cleaning... diff --git a/test_main.py b/test_main.py index b61ad91..2987ad1 100644 --- a/test_main.py +++ b/test_main.py @@ -195,9 +195,14 @@ def test_emptied_song(self) -> None: self.assertIn("Refrain", songs_temp[0].content.keys()) songs_temp = read_baiersbronn_songs_to_df() - def test_add_id_to_local_song_if_available_in_ct(self) -> None: # TODO #13 + def test_add_id_to_local_song_if_available_in_ct(self) -> None: """This should verify that add_id_to_local_song_if_available_in_ct is working as expected.""" - self.assertFalse(True, "Not Implemented") + self.assertFalse( + True, + "Not Implemented see https://github.com/bensteUEM/SongBeamerQS/issues/13", + ) + # TODO (bensteUEM): implement test_add_id_to_local_song_if_available_in_ct + # https://github.com/bensteUEM/SongBeamerQS/issues/13 def test_download_missing_online_songs(self) -> None: """ELKW1610.krz.tools specific test case for the named function (using 2 specific song IDs). @@ -245,13 +250,23 @@ def test_download_missing_online_songs(self) -> None: self.assertTrue(exists) Path(test2path).unlink() - def test_upload_new_local_songs_and_generate_ct_id(self) -> None: # TODO #15 + def test_upload_new_local_songs_and_generate_ct_id(self) -> None: """This should verify that upload_new_local_songs_and_generate_ct_id is working as expected.""" - self.assertFalse(True, "Not Implemented") + self.assertFalse( + True, + "Not Implemented see https://github.com/bensteUEM/SongBeamerQS/issues/32", + ) + # TODO (bensteUEM): implement test_upload_new_local_songs_and_generate_ct_id + # https://github.com/bensteUEM/SongBeamerQS/issues/32 def test_upload_local_songs_by_id(self) -> None: """This should verify that upload_local_songs_by_id is working as expected.""" - self.assertFalse(True, "Not Implemented") # TODO #14 + self.assertFalse( + True, + "Not Implemented see https://github.com/bensteUEM/SongBeamerQS/issues/14", + ) + # TODO (bensteUEM): implement test_upload_local_songs_by_id + # https://github.com/bensteUEM/SongBeamerQS/issues/14 def test_write_df_to_file(self) -> None: """Test method checking functionality of write_df_to_file. diff --git a/test_sng.py b/test_sng.py index 1a153f3..d303fb2 100644 --- a/test_sng.py +++ b/test_sng.py @@ -501,7 +501,8 @@ def test_header_eg_psalm_quality_checks(self) -> None: song = SngFile("testData/Psalm/726 Psalm 047_iso-8859-1.sng", "EG") self.assertNotIn("ChurchSongID", song.header.keys()) - # TODO Add test for language marker validation in EG psalms + # TODO (bensteUEM): Add test for language marker validation in EG psalms + # https://github.com/bensteUEM/SongBeamerQS/issues/36 # Test background image validation for EG Psalms self.assertFalse(song.validate_header_background(fix=False)) @@ -680,7 +681,8 @@ def test_generate_verses_from_unknown(self) -> None: set(expected_verse_markers) - {"STOP"}, set(existing_verse_markers) ) - # TODO optionally add test case for logged warning when new verse already exists in VerseOrder + # TODO (bensteUEM): optionally add test case for logged warning when new verse already exists in VerseOrder + # https://github.com/bensteUEM/SongBeamerQS/issues/35 def test_header_verse_order_special2(self) -> None: """Test case for special cases occured while running on sample files.