def test_bassist(): jaco = Bassist("Jaco Pastorious") assert jaco.name == "Jaco Pastorious" assert jaco.instrument == "bass" assert jaco.play_solo() == "thump, thump" assert jaco.__repr__() == "This is Bassist Jaco Pastorious" assert jaco.__str__() == "Bassist Jaco Pastorious"
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_bassist_instrument(): rehman = Bassist("AR Rehman") assert rehman.instrument == "bass".title()
def test_bassist_name(): rehman = Bassist("AR Rehman") assert rehman.name == "AR Rehman"
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_custom_solo_bass(): solo = "" aniruth = Bassist("Aniruth Ravichander", solo) assert aniruth.play_solo() == solo
def test_bassist_str(): assert 'This Band name is Rehman' == Bassist('Rehman').__str__()
def test_bassist_repr(): meshell = Bassist("Meshell Ndegeocello") actual = repr(meshell) expected = "Bassist instance. Name = Meshell Ndegeocello" assert actual == expected
def test_bassist_str(): meshell = Bassist("Meshell Ndegeocello") actual = str(meshell) expected = "My name is Meshell Ndegeocello and I play bass" assert actual == expected
def one_band(): some_band = Band( "Nirvana", [Guitarist("Kurt Cobain"), Bassist("Krist Novoselic"), Drummer("Dave Grohl"),], ) return some_band
def test_bassist(): jaco =Bassist("Jaco") assert jaco.name == "Jaco" assert jaco.instrument == "bass"
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_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_bassist_play_solo(): rehman = Bassist("AR Rehman") assert rehman.play_solo() == "Yeno Vaanilai Maaruthey"
def test_bassist(): flea = Bassist("Flea") assert flea.name == "Flea" assert flea.get_instrument() == "bass"
def test_bassist_repr(): assert 'Bassist instance' == Bassist('Rehman').__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_bassist_get_instrument(): assert 'bass'.title() == Bassist('Rehman').get_instrument()
def some_band(): nirvana = Band("Nirvana", [Guitarist("Curt Kobain"), Bassist("Kris, Novoselic"), Drummer("Dave Grohl")]) return nirvana
def test_musicians_members(): Musician.members = [] guitarist = Guitarist('Surya') bassist = Bassist('Rehman') drummer = Drummer('Sivamani') assert [guitarist, bassist, drummer] == Musician.members
def test_Bassist_fail(): musician6 = Bassist('Bass', 'Paradise City') actual = musician6.play_solo() expected = 'City' assert actual != expected