def test_to_list():
    with open('pythonic_garage_band/twobands.json', 'r') as file:
        bands = json.loads(file.read())

    assert len(bands) == 2

    Band.create_from_data(bands[0])
    Band.create_from_data(bands[1])

    assert len(Band.to_list()) == 2
Beispiel #2
0
def test_to_list():
    assert Band.to_list() == []
    Band("The Nobodies", [])
    assert len(Band.to_list()) == 1
Beispiel #3
0
def test_band_to_list():
    test_band1 = Band("test",[Guitarist("test1")]);
    assert len(test_band1.to_list())>0
Beispiel #4
0
def test_create_bands():
    Band.create_from_data('pythonic_garage_band\\assets\\bands.yaml')
    assert str(Band.to_list()[0]) == "The band Band1"
    assert str(Band.to_list()[1]) == "The band Band2"
    assert repr(Band.to_list()[0]) == "The band instance with name = Band1, members = [Bassist instance. Name: Simon, Guitarist instance. Name: Krishnan]"
    assert repr(Band.to_list()[1]) == "The band instance with name = Band2, members = [drummer instance. Name: Vara, Guitarist instance. Name: JB]"
Beispiel #5
0
def test_band_list():
  assert Band.to_list() == []
  slipknot = Band('Slipknot', '[Corey, James]')
  assert len(Band.to_list()) == 1