Exemplo n.º 1
0
def some_band():
    beatles = Band("The Beatles", [
        Guitarist("John Lennon"),
        Bassist("Paul McCartney"),
        Drummer("Siva Mani")
    ], ["Sympathy for the Devil", "Light My Fire", "Sharp Dressed Man"])
    return beatles
def prep_data():
    bashar = Guitarest("Bashar")
    samer = Bassist("Samer")
    saed = Drummer("Saed")
    ahmad = Singer("Ahmad")
    band1 = (Band("Pandora Box", [ahmad, bashar, samer, saed]))
    return {'bashar': bashar, 'samer': samer, 'saed': saed, 'ahmad': ahmad}
def one_band():
    some_band = Band(
        "Nirvana",
        [
            Guitarist("Kurt Cobain"),
            Bassist("Krist Novoselic"),
            Drummer("Dave Grohl"),
        ],
    )
    return some_band
Exemplo n.º 4
0
def test_drummer():
    siva = Drummer("Siva Mani")
    assert siva.name == "Siva Mani"
    assert siva.get_instrument() == "Drums"
    assert siva.play_solo() == "Sharp Dressed Man"
    assert siva.__str__() == "Siva Mani plays Drums"
    assert siva.__repr__() == "Musician(Siva Mani,Drums)"
Exemplo n.º 5
0
def allData():

    bryan = Bassist("bryan", "Bassist")
    Yiannis_Chryssomallis = Guitarist("Yiannis_Chryssomallis")
    Charlie_Adams = Drummer("Charlie_Adams")
    George = Band("George X", [bryan, Yiannis_Chryssomallis, Charlie_Adams],
                  "Careless Whisper")
    return {
        'bryan': bryan,
        'Yiannis_Chryssomallis': Yiannis_Chryssomallis,
        'Charlie_Adams': Charlie_Adams,
        'George': George
    }
def test_play_solo():
    actual = Drummer('drummer', 'drumm').play_solo()
    expected = 'drummer is playing solo on the drumm'
    assert actual == expected
def dummy_drummer():
    return Drummer("Alfonso Andre")
def dummy_band():
    my_band = Band("Caifanes")
    my_band.add_member(Guitarist("Carlos Santanna"))
    my_band.add_member(Bassist("Sabo Romo"))
    my_band.add_member(Drummer("Alfonso Andre"))
    return my_band
def test_drummer_repr():
    sheila = Drummer("Sheila E.")
    actual = repr(sheila)
    expected = "Drummer instance. Name = Sheila E."
    assert actual == expected
def test_drummer():
    ginger = Drummer("Ginger Baker")
    assert ginger.name == "Ginger Baker"
    assert ginger.get_instrument() == "drums"
def prep_data():
    
    mahmoud=Bassist("mahmoud","Bassist")
    ahmad=Guitarist("ahmad","Guitarist")
    noor=Drummer("noor","Drummer")
    return {'ahmad':ahmad, 'mahmoud':mahmoud, 'noor':noor}
def test_drummer_str():
    sheila = Drummer("Sheila E.")
    actual = str(sheila)
    expected = "My name is Sheila E. and I play drums"
    assert actual == expected
def create_band_members():
    Musician.members = []
    leah = Guitarist("Leah")
    ron = Drummer("Ron")
    hermy = Guitarist("Hermy")
    harry = Bassist("Harry")
Exemplo n.º 14
0

def test_version():
    assert __version__ == '0.1.0'


# @pytest.mark.skip(reason='Testing Count')
# def test_play_solos():
#     ali = Band.Guitarist('ali') # preparing data
#     ahmad = Band.Drummer('ahmad')
#     soso = Band.Bassist('soso')
#     expected = "ali play solo\nahmad play solo\nsoso play solo\n"
#     actual = soso.play_solos()
#     assert actual == expected
aziz = Guitarist('Aziz')
saleh = Drummer('Saleh')
emad = Bassist('Emad')
tarbanin = Band('tarbanin')
tarbanin.add_members(aziz)
tarbanin.add_members(saleh)
tarbanin.add_members(emad)


# @pytest.fixture
# def prep_data():
#     aziz = Band.Guitarist('Aziz') # preparing data
#     saleh = Band.Drummer('Saleh')
#     emad = Band.Bassist('Emad')
#     #preparing data
#     return {'aziz':aziz, 'saleh':saleh, 'emad':emad}
def test_to_list():
def test_drummer_name():
    actual = Drummer("Ron").name
    expected = "Ron"
    assert expected == actual
from pythonic_garage_band import __version__
from pythonic_garage_band.pythonic_garage_band import Band, Musician, Guitarist, Bassist, Drummer
import pytest


def test_version():
    assert __version__ == '0.1.0'


## preparing the data

mike = Guitarist('mike')
carlos = Drummer('carlos')
john = Bassist('john')

maroon5 = Band('maroon5')
maroon5.add_members(mike)
maroon5.add_members(carlos)
maroon5.add_members(john)

#########################################################################
########## Tests ###############
#########################################################################


def test_to_list(cls):
    expected = [mike, carlos, john]
    actual = maroon5.to_list()
    assert actual == expected

Exemplo n.º 17
0
from pythonic_garage_band import __version__
from pythonic_garage_band.pythonic_garage_band import Band, Musician, Guitarist, Bassist, Drummer


def test_version():
    assert __version__ == '0.1.0'


nemrawi = Band('nemrawi')
abo_anwar = Musician('abo_anwar')
shareef = Guitarist('shareef')
mahmoud = Drummer('mahmoud')
ali = Bassist('ali')


def test_Band_band_list():
    expected = [nemrawi]
    actual = Band.band_list
    assert expected == actual


def test_add_members_to_list():
    nemrawi.add_members('jafar')
    nemrawi.add_members('9ob7y')

    expected = ['jafar', '9ob7y']
    actual = nemrawi.to_list()
    assert expected == actual


def test_Musician_play_solo():