From f4649cd3ac75a4819500a4fe4a6dafa9260ea2e1 Mon Sep 17 00:00:00 2001 From: Hellow2 Date: Tue, 28 Mar 2023 09:18:42 +0200 Subject: [PATCH] layed out tests, arent finished though --- src/tests/building_objects.py | 93 +++++++++++++++++++++++++++++++++++ 1 file changed, 93 insertions(+) create mode 100644 src/tests/building_objects.py diff --git a/src/tests/building_objects.py b/src/tests/building_objects.py new file mode 100644 index 0000000..46bb7bb --- /dev/null +++ b/src/tests/building_objects.py @@ -0,0 +1,93 @@ +from mutagen import id3 +import pycountry +import unittest +import sys +import os +from pathlib import Path + +# Add the parent directory of the src package to the Python module search path +sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) +from music_kraken import objects + +""" +Testing the Formatted text is barely possible cuz one false character and it fails. +Not worth the trouble +""" + + +class TestSong(unittest.TestCase): + + def setUp(self): + self.album_list = [ + objects.Album( + title="One Final Action", + date=objects.ID3Timestamp(year=1986, month=3, day=1), + language=pycountry.languages.get(alpha_2="en"), + label_list=[ + objects.Label(name="an album label") + ], + source_list=[ + objects.Source(objects.SourcePages.ENCYCLOPAEDIA_METALLUM, + "https://www.metal-archives.com/albums/I%27m_in_a_Coffin/One_Final_Action/207614") + ] + ), + ] + + self.artist_list = [] + + main_artist_list=[ + objects.Artist( + name="I'm in a coffin", + source_list=[ + objects.Source( + objects.SourcePages.ENCYCLOPAEDIA_METALLUM, + "https://www.metal-archives.com/bands/I%27m_in_a_Coffin/127727" + ) + ] + ), + objects.Artist(name="some_split_artist") + ] + feature_artist_list=[ + objects.Artist( + name="Ruffiction", + label_list=[ + objects.Label(name="Ruffiction Productions") + ] + ) + ] + + self.artist_list.extend(main_artist_list) + self.artist_list.extend(feature_artist_list) + + self.song = objects.Song( + genre="HS Core", + title="Vein Deep in the Solution", + length=666, + isrc="US-S1Z-99-00001", + tracksort=2, + target_list=[ + objects.Target(file="song.mp3", path="example") + ], + lyrics_list=[ + objects.Lyrics( + text="these are some depressive lyrics", language="en"), + objects.Lyrics( + text="Dies sind depressive Lyrics", language="de") + ], + source_list=[ + objects.Source(objects.SourcePages.YOUTUBE, + "https://youtu.be/dfnsdajlhkjhsd"), + objects.Source(objects.SourcePages.MUSIFY, + "https://ln.topdf.de/Music-Kraken/") + ], + album_list=self.album_list, + main_artist_list=main_artist_list, + feature_artist_list=feature_artist_list, + ) + + def test_album(self): + pass + + def test_artist(self): + pass +