def test_travaso(): tarallo_session = Tarallo(t_url, t_token) test_item = tarallo_session.travaso("schifomacchina", "RamBox") assert test_item item_r69 = tarallo_session.get_item("R69") assert item_r69 is not None assert type(item_r69) == Item assert item_r69.code == 'R69' assert isinstance(item_r69.features, dict) assert item_r69.location == 'RamBox' item_r188 = tarallo_session.get_item("R188") assert item_r188 is not None assert type(item_r188) == Item assert item_r188.code == 'R188' assert isinstance(item_r188.features, dict) assert item_r188.location == 'RamBox' tarallo_session.move("R69", "schifomacchina") tarallo_session.move("R188", "schifomacchina")
def test_travaso(): tarallo_session = Tarallo(t_url, t_token) test_item = tarallo_session.travaso("1", "LabFis4") assert test_item is True item_a2 = tarallo_session.get_item("A2") assert item_a2 is not None assert type(item_a2) == Item assert item_a2.code == 'A2' assert isinstance(item_a2.features, dict) assert item_a2.location == 'LabFis4' item_b1 = tarallo_session.get_item("B1") assert item_b1 is not None assert type(item_b1) == Item assert item_b1.code == 'B1' assert isinstance(item_b1.features, dict) assert item_b1.location == 'LabFis4' tarallo_session.move("A2", "1") tarallo_session.move("B1", "1")
def test_travaso_invalid_location(): tarallo_session = Tarallo(t_url, t_token) # Cannot place a computer in a RAM tarallo_session.travaso("schifomacchina", "R180")
def test_travaso_not_existing_location(): tarallo_session = Tarallo(t_url, t_token) tarallo_session.travaso("schifomacchina", "BIGASD")
def test_travaso_invalid_item(): tarallo_session = Tarallo(t_url, t_token) tarallo_session.travaso("BIGASD", "Table")
def test_travaso_invalid_location(): tarallo_session = Tarallo(t_url, t_token) # Cannot place the insides of a computer in a CPU tarallo_session.travaso("1", "C123")
def test_travaso_not_existing_location(): tarallo_session = Tarallo(t_url, t_token) # TODO: "Cannot move A2 into BIGASD", returns 400... WHY? tarallo_session.travaso("1", "BIGASD")