Skip to content
Snippets Groups Projects
Commit 9e275b0f authored by David Trattnig's avatar David Trattnig
Browse files

test: update per domain changes

parent 08ea8605
No related branches found
No related tags found
1 merge request!35ORM-less scheduling
...@@ -57,7 +57,7 @@ class TestDomain(unittest.TestCase): ...@@ -57,7 +57,7 @@ class TestDomain(unittest.TestCase):
id=333, repetition_id=888, start=1675463003, end=1675466003, show=show, episode=episode id=333, repetition_id=888, start=1675463003, end=1675466003, show=show, episode=episode
) )
ts.set_playlists(Playlist(), Playlist(), Playlist()) ts.set_playlists(Playlist(1), Playlist(2), Playlist(3))
def test_timeslot_to_string(self): def test_timeslot_to_string(self):
print(self._testMethodName) print(self._testMethodName)
...@@ -77,7 +77,7 @@ class TestDomain(unittest.TestCase): ...@@ -77,7 +77,7 @@ class TestDomain(unittest.TestCase):
def test_playlist_init(self): def test_playlist_init(self):
print(self._testMethodName) print(self._testMethodName)
pl = Playlist() pl = Playlist(1)
pl.id: 333 pl.id: 333
pl.timeslot: Timeslot() pl.timeslot: Timeslot()
...@@ -90,9 +90,9 @@ class TestDomain(unittest.TestCase): ...@@ -90,9 +90,9 @@ class TestDomain(unittest.TestCase):
id=333, repetition_id=888, start=1675463003, end=1675466003, show=None, episode=None id=333, repetition_id=888, start=1675463003, end=1675466003, show=None, episode=None
) )
pl_timeslot = Playlist() pl_timeslot = Playlist(1)
pl_schedule = Playlist() pl_schedule = Playlist(2)
pl_show = Playlist() pl_show = Playlist(3)
ts.set_playlists(pl_timeslot, None, None) ts.set_playlists(pl_timeslot, None, None)
ts.set_playlists(None, pl_schedule, None) ts.set_playlists(None, pl_schedule, None)
...@@ -108,13 +108,13 @@ class TestDomain(unittest.TestCase): ...@@ -108,13 +108,13 @@ class TestDomain(unittest.TestCase):
def test_playlist_duration_zero(self): def test_playlist_duration_zero(self):
print(self._testMethodName) print(self._testMethodName)
pl = Playlist() pl = Playlist(1)
self.assertEqual(0, pl.get_duration()) self.assertEqual(0, pl.get_duration())
def test_playlist_add_items(self): def test_playlist_add_items(self):
print(self._testMethodName) print(self._testMethodName)
pl = Playlist() pl = Playlist(1)
e1 = PlaylistItem("file1.flac", 2, 100, PlaylistItem.Metadata("a1", "b1", "c1")) e1 = PlaylistItem("file1.flac", 2, 100, PlaylistItem.Metadata("a1", "b1", "c1"))
e2 = PlaylistItem("file2.flac", 3, 100, PlaylistItem.Metadata("a2", "b2", "c2")) e2 = PlaylistItem("file2.flac", 3, 100, PlaylistItem.Metadata("a2", "b2", "c2"))
e3 = PlaylistItem("file3.flac", 5, 100, PlaylistItem.Metadata("a3", "b3", "c3")) e3 = PlaylistItem("file3.flac", 5, 100, PlaylistItem.Metadata("a3", "b3", "c3"))
...@@ -127,7 +127,7 @@ class TestDomain(unittest.TestCase): ...@@ -127,7 +127,7 @@ class TestDomain(unittest.TestCase):
def test_playlist_duration(self): def test_playlist_duration(self):
print(self._testMethodName) print(self._testMethodName)
pl = Playlist() pl = Playlist(1)
e1 = PlaylistItem("file1.flac", 2, 100, PlaylistItem.Metadata("a1", "b1", "c1")) e1 = PlaylistItem("file1.flac", 2, 100, PlaylistItem.Metadata("a1", "b1", "c1"))
e2 = PlaylistItem("file2.flac", 3, 100, PlaylistItem.Metadata("a2", "b2", "c2")) e2 = PlaylistItem("file2.flac", 3, 100, PlaylistItem.Metadata("a2", "b2", "c2"))
e3 = PlaylistItem("file3.flac", 5, 100, PlaylistItem.Metadata("a3", "b3", "c3")) e3 = PlaylistItem("file3.flac", 5, 100, PlaylistItem.Metadata("a3", "b3", "c3"))
...@@ -142,7 +142,7 @@ class TestDomain(unittest.TestCase): ...@@ -142,7 +142,7 @@ class TestDomain(unittest.TestCase):
ts = Timeslot(id=333, repetition_id=888, start=100, end=120, show=None, episode=None) ts = Timeslot(id=333, repetition_id=888, start=100, end=120, show=None, episode=None)
pl = Playlist() pl = Playlist(1)
e1 = PlaylistItem("file1.flac", 2, 100, PlaylistItem.Metadata("a1", "b1", "c1")) e1 = PlaylistItem("file1.flac", 2, 100, PlaylistItem.Metadata("a1", "b1", "c1"))
e2 = PlaylistItem("file2.flac", 3, 100, PlaylistItem.Metadata("a2", "b2", "c2")) e2 = PlaylistItem("file2.flac", 3, 100, PlaylistItem.Metadata("a2", "b2", "c2"))
e3 = PlaylistItem("file3.flac", 5, 100, PlaylistItem.Metadata("a3", "b3", "c3")) e3 = PlaylistItem("file3.flac", 5, 100, PlaylistItem.Metadata("a3", "b3", "c3"))
...@@ -169,7 +169,7 @@ class TestDomain(unittest.TestCase): ...@@ -169,7 +169,7 @@ class TestDomain(unittest.TestCase):
ts = Timeslot(id=333, repetition_id=888, start=100, end=200, show=None, episode=None) ts = Timeslot(id=333, repetition_id=888, start=100, end=200, show=None, episode=None)
pl = Playlist() pl = Playlist(1)
e1 = PlaylistItem("file1.flac", 2, 100, PlaylistItem.Metadata("a1", "b1", "c1")) e1 = PlaylistItem("file1.flac", 2, 100, PlaylistItem.Metadata("a1", "b1", "c1"))
e2 = PlaylistItem("file2.flac", 3, 100, PlaylistItem.Metadata("a2", "b2", "c2")) e2 = PlaylistItem("file2.flac", 3, 100, PlaylistItem.Metadata("a2", "b2", "c2"))
e3 = PlaylistItem("file3.flac", 5, 100, PlaylistItem.Metadata("a3", "b3", "c3")) e3 = PlaylistItem("file3.flac", 5, 100, PlaylistItem.Metadata("a3", "b3", "c3"))
...@@ -210,7 +210,7 @@ class TestDomain(unittest.TestCase): ...@@ -210,7 +210,7 @@ class TestDomain(unittest.TestCase):
print(self._testMethodName) print(self._testMethodName)
ts = Timeslot(id=333, repetition_id=888, start=100, end=200, show=None, episode=None) ts = Timeslot(id=333, repetition_id=888, start=100, end=200, show=None, episode=None)
pl = Playlist() pl = Playlist(1)
item = PlaylistItem( item = PlaylistItem(
"https://stream.your.radio", 3, 100, PlaylistItem.Metadata("a2", "b2", "c2") "https://stream.your.radio", 3, 100, PlaylistItem.Metadata("a2", "b2", "c2")
) )
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment