From 012aac5b2c648fd6010fdb1fecc47c7d3209e4f3 Mon Sep 17 00:00:00 2001 From: James Clarke Date: Thu, 23 Mar 2023 17:30:06 +0000 Subject: [PATCH] Made unit tests --- src/tests/test_objects.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/tests/test_objects.py b/src/tests/test_objects.py index 8b27ac9..bcd3ce5 100644 --- a/src/tests/test_objects.py +++ b/src/tests/test_objects.py @@ -5,10 +5,13 @@ import sys import os # Add the parent directory of the src package to the Python module search path -sys.path.append(os.path.abspath(os.path.join(os.path.dirname(__file__), ".."))) +sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) from music_kraken import objects +from music_kraken import metadata + + class TestSong(unittest.TestCase): def setUp(self): @@ -149,7 +152,7 @@ class TestAlbum(unittest.TestCase): class TestCollection(unittest.TestCase): def setUp(self): - self.collection = objects.Collection( + self.collection = objects.collection.Collection( title="A collection", date=objects.ID3Timestamp(year=1986, month=3, day=1), language=pycountry.languages.get(alpha_2="en"), @@ -163,7 +166,7 @@ class TestCollection(unittest.TestCase): ) def test_collection_title(self): - self.assertEqual(self.collection.title, "A collection") + self.assertEqual(self.collection, "A collection") def test_collection_date(self): self.assertEqual(self.collection.date.year, 1986)