Exemplo n.º 1
0
def test_normal_add():
    ship = Spacecraft(100)

    # Adding and removing a Fuel Processor
    fuel_processor = Misc("Fuel Processors", 1)
    ship.modify_misc(fuel_processor)
    assert ship.get_remaining_cargo() == 99
    assert ship.get_total_cost() == 2.05
    ship.remove_misc("Fuel Processors")
    assert ship.get_remaining_cargo() == 100
    assert ship.get_total_cost() == 2.0
Exemplo n.º 2
0
def test_repair_drones():
    ship = Spacecraft(100)

    # Adding repair drones and checking dynamic costs
    repair_drones = Misc("Repair Drones", 1)
    ship.modify_misc(repair_drones)
    assert ship.get_remaining_cargo() == 99.0
    assert ship.get_total_cost() == 2.2

    # Removing the drone
    ship.remove_misc("Repair Drones")
    assert ship.get_remaining_cargo() == 100
    assert ship.get_total_cost() == 2.0