modified diagram

This commit is contained in:
Hellow 2023-03-24 19:07:37 +01:00
parent 7ee02440c8
commit 6d2a7469fc
2 changed files with 45 additions and 9 deletions

View File

@ -156,21 +156,21 @@ Source {
} }
Source }o--|| Song : from Source }o--|| Song : ""
Source }o--|| Lyrics : from Source }o--|| Lyrics : ""
Source }o--|| Album : from Source }o--|| Album : ""
Source }o--|| Artist : from Source }o--|| Artist : ""
Source }o--|| Label : from Source }o--|| Label : ""
Song }o--o{ Album : AlbumSong Song }o--o{ Album : AlbumSong
Album }o--o{ Artist : ArtistAlbum Album }o--o{ Artist : ArtistAlbum
Song }o--o{ Artist : features Song }o--o{ Artist : "ArtistSong (features)"
Label }o--o{ Album : LabelAlbum Label }o--o{ Album : LabelAlbum
Label }o--o{ Artist : LabelSong Label }o--o{ Artist : LabelSong
Song ||--o{ Lyrics : contains Song ||--o{ Lyrics : ""
Song ||--o{ Target : points Song ||--o{ Target : ""
``` ```
Ok now this **WILL** look intimidating, thus I break it down quickly. Ok now this **WILL** look intimidating, thus I break it down quickly.
@ -216,7 +216,7 @@ Label {
Song }o--o{ Album : AlbumSong Song }o--o{ Album : AlbumSong
Album }o--o{ Artist : ArtistAlbum Album }o--o{ Artist : ArtistAlbum
Song }o--o{ Artist : features Song }o--o{ Artist : "ArtistSong (features)"
Label }o--o{ Album : LabelAlbum Label }o--o{ Album : LabelAlbum
Label }o--o{ Artist : LabelSong Label }o--o{ Artist : LabelSong

View File

@ -169,6 +169,42 @@ class TestCollection(unittest.TestCase):
self.assertIn(song.unified_title, self.unified_titels) self.assertIn(song.unified_title, self.unified_titels)
class TestCollectionAppending(unittest.TestCase):
def setUp(self):
self.song_list: objects.song = [
objects.Song(title="hasskrank"),
objects.Song(title="HaSSkrank"),
objects.Song(title="Suicideseason", isrc="uniqueID"),
objects.Song(title="same isrc different title", isrc="uniqueID")
]
self.unified_titels = set(song.unified_title for song in self.song_list)
def test_appending(self):
collection = objects.Collection(
element_type=objects.Song,
data=self.song_list
)
res = collection.append(self.song_list[0])
self.assertEqual(res.was_in_collection, False)
self.assertEqual(res.current_element, self.song_list[0])
res = collection.append(self.song_list[1])
self.assertEqual(res.was_in_collection, True)
self.assertEqual(res.current_element, self.song_list[0])
res = collection.append(self.song_list[2])
self.assertEqual(res.was_in_collection, False)
self.assertEqual(res.current_element, self.song_list[2])
res = collection.append(self.song_list[3])
self.assertEqual(res.was_in_collection, True)
self.assertEqual(res.current_element, self.song_list[2])
class TestLyrics(unittest.TestCase): class TestLyrics(unittest.TestCase):