コード例 #1
0
ファイル: test.py プロジェクト: Nanko-Nanev/python_oop
 def test_details(self):
     album = Album("The Sound of Perseverance")
     song = Song("Scavenger of Human Sorrow", 6.56, False)
     album.add_song(song)
     message = album.details()
     expected = "Album The Sound of Perseverance\n== Scavenger of Human Sorrow - 6.56\n"
コード例 #2
0
from project.band import Band
from project.album import Album

from project.song import Song

if __name__ == "__main__":

    song = Song("Running in the 90s", 3.45, False)
    print(song.get_info())
    album = Album("Initial D", song)
    second_song = Song("Around the World", 2.34, False)
    print(album.add_song(second_song))
    print(album.details())
    print(album.publish())
    band = Band("Manuel")
    print(band.add_album(album))
    print(band.remove_album("Initial D"))
    print(band.details())
コード例 #3
0
ファイル: test.py プロジェクト: Nanko-Nanev/python_oop
 def test_album_init(self):
     album = Album("The Sound of Perseverance")
     message = album.details()
     expected = "Album The Sound of Perseverance\n"
     self.assertEqual(message, expected)