def test_guitarist(): jimi = Guitarist("Jimi Hendrix") assert jimi.name == "Jimi Hendrix" assert jimi.instrument == "guitar" assert jimi.play_solo() == "face melting guitar wailing" assert jimi.__repr__() == "This is Guitarist Jimi Hendrix" assert jimi.__str__() == "Guitarist Jimi Hendrix"
def harmony_band3(): harmony = Band ( "harmony", [Drummer("Sivamani"), Guitarist("Surya"), Bassist("Rehman")] ) return harmony
def some_band(): assert some_band.name == "Nirvana" nirvana = Band("Nirvana", [Guitarist("Curt Kobian"), Bassist("Kris Nov"), Drummer("Dave") ]) return nirvana
def test_band_members(): test_band = Band("test",[Guitarist("test1"),Bassist("test2")]); assert test_band.members[0].name == "test1" assert test_band.members[0].instrument == "Guitar" assert test_band.members[1].name == "test2" assert test_band.members[1].instrument == "Bass"
def test_three(): jwan = Guitarist('Jwan', 'Guitarist') actual = "tun tun ttattatun" expected = jwan.play_solo() assert expected == actual
def test_musicians_members(): Musician.members = [] guitarist = Guitarist('Surya') bassist = Bassist('Rehman') drummer = Drummer('Sivamani') assert [guitarist, bassist, drummer] == Musician.members
def test_guitarist_str(): assert 'This Band name is Surya' == Guitarist('Surya').__str__()
def test_guitarist_play_solo(): surya = Guitarist("Surya Sivakumar") assert surya.play_solo() =="En Iniya Pon Nilave"
def one_band(): some_band = Band( "Nirvana", [Guitarist("Kurt Cobain"), Bassist("Krist Novoselic"), Drummer("Dave Grohl"),], ) return some_band
def test_guitarist(): jimi =Guitarist("Jimi") assert jimi.name == "Jimi" assert jimi.instrument == "guitar"
def test_musician_get_instrument(): test_musician1 = Guitarist("test1") test_musician2 = Bassist("test1") assert test_musician1.get_instrument() == 'Guitar' assert test_musician2.get_instrument() == 'Bass'
def test_band_to_list(): test_band1 = Band("test",[Guitarist("test1")]); assert len(test_band1.to_list())>0
def test_band_play_solo(): test_band = Band("test",[Guitarist("test1"),Bassist("test2")]); assert test_band.play_solos() == ["test1 Playing solo guitar","test2 Playing solo bass"]
def test_custom_solo_guitarist(): jimi = Guitarist("Jimi Hendrix", "wonk wonk") assert jimi.name == "Jimi Hendrix" assert jimi.instrument == "guitar" assert jimi.play_solo() == "wonk wonk"
def test_guitarist_repr(): joan = Guitarist("Joan Jett") actual = repr(joan) expected = "Guitarist instance. Name = Joan Jett" assert actual == expected
def test_guitarist_name(): surya = Guitarist("Surya Sivakumar") assert surya.name == "Surya Sivakumar"
def test_guitarist(): jimi = Guitarist("Jimi Hendrix") assert jimi.name == "Jimi Hendrix" assert jimi.get_instrument() == "guitar"
def test_guitarist_instrument(): surya = Guitarist("Surya Sivakumar") assert surya.instrument == "guitar".title()
def test_guitarist_str(): joan = Guitarist("Joan Jett") actual = str(joan) expected = "My name is Joan Jett and I play guitar" assert actual == expected
def test_guitarist_repr(): assert 'Guitarist instance' == Guitarist('Surya').__repr__()
import json import pytest from pythonic_garage_band.garage_band import Musician, Guitarist, Bassist, Drummer, Band BandData = {"Band Name": "Volcano", "Members": [Guitarist("Tom"), Drummer("Robert"), Bassist("Riley")]} def test_abstract_musician(): with pytest.raises(TypeError): Musician("?", "?") def test_musician_get_instrument(): assert Guitarist("Mystery").get_instrument() == "guitar" def test_guitarist(): jimi = Guitarist("Jimi Hendrix") assert jimi.name == "Jimi Hendrix" assert jimi.instrument == "guitar" assert jimi.play_solo() == "face melting guitar wailing" assert jimi.__repr__() == "This is Guitarist Jimi Hendrix" assert jimi.__str__() == "Guitarist Jimi Hendrix" def test_bassist(): jaco = Bassist("Jaco Pastorious")
def test_guitarist_get_instrument(): assert 'guitar'.title() == Guitarist('Surya').get_instrument()
def some_band(): nirvana = Band("Nirvana", [Guitarist("Curt Kobain"), Bassist("Kris, Novoselic"), Drummer("Dave Grohl")]) return nirvana
def test_two(): jwan = Guitarist('Jwan', 'Guitarist') actual = "guitar" expected = jwan.get_instrument() assert expected == actual
def test_musician_get_instrument(): assert Guitarist("Mystery").get_instrument() == "guitar"
def test_one(): jwan = Guitarist('Jwan', 'Guitarist') actual = "I'm Jwan, and I play Guitar" expected = jwan.__str__() assert expected == actual
def test_Musician_pass(): musician1 = Guitarist('guitar', 'We are the champions') actual = musician1.play_solo() expected = 'We are the champions' assert actual == expected