コード例 #1
0
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"
コード例 #2
0
def harmony_band3():
    harmony = Band (
        "harmony", 
        [Drummer("Sivamani"), Guitarist("Surya"), Bassist("Rehman")]
    )

    return harmony
コード例 #3
0
def some_band():
    assert some_band.name == "Nirvana"

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

    ])

    return nirvana
コード例 #4
0
def test_bassist_instrument():
    rehman = Bassist("AR Rehman")
    assert rehman.instrument == "bass".title()
コード例 #5
0
def test_bassist_name():
    rehman = Bassist("AR Rehman")
    assert rehman.name == "AR Rehman"
コード例 #6
0
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"
コード例 #7
0
def test_custom_solo_bass():
    solo = ""
    aniruth = Bassist("Aniruth Ravichander", solo)
    assert aniruth.play_solo() == solo
コード例 #8
0
def test_bassist_str():
    assert 'This Band name is Rehman' == Bassist('Rehman').__str__()
コード例 #9
0
def test_bassist_repr():
    meshell = Bassist("Meshell Ndegeocello")
    actual = repr(meshell)
    expected = "Bassist instance. Name = Meshell Ndegeocello"
    assert actual == expected
コード例 #10
0
def test_bassist_str():
    meshell = Bassist("Meshell Ndegeocello")
    actual = str(meshell)
    expected = "My name is Meshell Ndegeocello and I play bass"
    assert actual == expected
コード例 #11
0
def one_band():
    some_band = Band(
        "Nirvana",
        [Guitarist("Kurt Cobain"), Bassist("Krist Novoselic"), Drummer("Dave Grohl"),],
    )
    return some_band
コード例 #12
0
def test_bassist():
    jaco =Bassist("Jaco")
    assert jaco.name == "Jaco"
    assert jaco.instrument == "bass"
コード例 #13
0
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'
コード例 #14
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"]
コード例 #15
0
def test_bassist_play_solo():
    rehman = Bassist("AR Rehman")
    assert rehman.play_solo() == "Yeno Vaanilai Maaruthey"
コード例 #16
0
def test_bassist():
    flea = Bassist("Flea")
    assert flea.name == "Flea"
    assert flea.get_instrument() == "bass"
コード例 #17
0
def test_bassist_repr():
    assert 'Bassist instance' == Bassist('Rehman').__repr__()
コード例 #18
0
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")
コード例 #19
0
def test_bassist_get_instrument():
    assert 'bass'.title() == Bassist('Rehman').get_instrument()
コード例 #20
0
def some_band():
    nirvana = Band("Nirvana",
                   [Guitarist("Curt Kobain"), Bassist("Kris, Novoselic"), Drummer("Dave Grohl")])
    return nirvana
コード例 #21
0
def test_musicians_members():
    Musician.members = []
    guitarist = Guitarist('Surya')
    bassist = Bassist('Rehman')
    drummer = Drummer('Sivamani')
    assert [guitarist, bassist, drummer] == Musician.members
コード例 #22
0
def test_Bassist_fail():
    musician6 = Bassist('Bass', 'Paradise City')
    actual = musician6.play_solo()
    expected = 'City'
    assert actual != expected