def test_drummer():
    sheila = Drummer("Sheila Escovedo")
    assert sheila.name == "Sheila Escovedo"
    assert sheila.instrument == "drums"
    assert sheila.play_solo() == "boom boom"
    assert sheila.__repr__() == "This is Drummer Sheila Escovedo"
    assert sheila.__str__() == "Drummer Sheila Escovedo"
def harmony_band3():
    harmony = Band (
        "harmony", 
        [Drummer("Sivamani"), Guitarist("Surya"), Bassist("Rehman")]
    )

    return harmony
Ejemplo n.º 3
0
def some_band():
    assert some_band.name == "Nirvana"

    nirvana = Band("Nirvana",
    [Guitarist("Curt Kobian"),
    Bassist("Kris Nov"),
    Drummer("Dave")

    ])

    return nirvana
def test_drummer_str():
    assert 'This Band name is Sivamani' == Drummer('Sivamani').__str__()
def test_drummer_repr():
    assert 'Drummer instance' == Drummer('Sivamani').__repr__()
def test_drums_play_solo():
    siva = Drummer("Drums Sivamani")
    assert siva.play_solo() == "Puthu Vellai Mazhai"
def test_drums_instrument():
    siva = Drummer("Drums Sivamani")
    assert siva.instrument == "drum".title()
def test_drums_name():
    siva = Drummer("Drums Sivamani")
    assert siva.name == "Drums Sivamani"
Ejemplo n.º 9
0
def test_drums():
    sheila =Drummer("Sheila")
    assert sheila.name == "Sheila"
    assert sheila.instrument == "drums"
def some_band():
    nirvana = Band("Nirvana",
                   [Guitarist("Curt Kobain"), Bassist("Kris, Novoselic"), Drummer("Dave Grohl")])
    return nirvana
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")
Ejemplo n.º 12
0
def test_drummer():
    ginger = Drummer("Ginger Baker")
    assert ginger.name == "Ginger Baker"
    assert ginger.get_instrument() == "drums"
Ejemplo n.º 13
0
def test_drummer_repr():
    sheila = Drummer("Sheila E.")
    actual = repr(sheila)
    expected = "Drummer instance. Name = Sheila E."
    assert actual == expected
Ejemplo n.º 14
0
def test_drummer_str():
    sheila = Drummer("Sheila E.")
    actual = str(sheila)
    expected = "My name is Sheila E. and I play drums"
    assert actual == expected
Ejemplo n.º 15
0
def one_band():
    some_band = Band(
        "Nirvana",
        [Guitarist("Kurt Cobain"), Bassist("Krist Novoselic"), Drummer("Dave Grohl"),],
    )
    return some_band
def test_drummer_get_instrument():
    assert 'drum'.title() == Drummer('Sivamani').get_instrument()
def test_musicians_members():
    Musician.members = []
    guitarist = Guitarist('Surya')
    bassist = Bassist('Rehman')
    drummer = Drummer('Sivamani')
    assert [guitarist, bassist, drummer] == Musician.members
def test_Drummer_pass():
    musician2 = Drummer('Drum', 'Somebody to love')
    actual = musician2.play_solo()
    expected = 'Somebody to love'
    assert actual == expected