Exemple #1
0
def test_throttle_status_report():
    thruster = Thruster(max_force=15)
    Ship(port_panel=ShipPanel(side=PORT, thrusters=[thruster]))
    assert thruster.status_report["throttle"] == thruster.throttle, \
        "Thruster throttle is innacurately reported"
Exemple #2
0
def test_power_available_status_report():
    ship = Ship(port_panel=ShipPanel(side=PORT,
                                     thrusters=[Thruster(max_force=15)]),
                reactors=[Reactor(max_output=100)])
    assert ship.status_report["power_available"] == ship.power_available, \
        "Thruster vector is innacurately reported"
Exemple #3
0
def test_powered_on_status_report():
    thruster = Thruster(max_force=15)
    Ship(port_panel=ShipPanel(side=PORT, thrusters=[thruster]))
    thruster.powered_on = False
    assert thruster.status_report["powered_on"] == thruster.powered_on, \
        "Thruster powered_on is innacurately reported"
Exemple #4
0
def test_power_consumption_high_throttle_status_report():
    t = Thruster(max_force=15)
    Ship(port_panel=ShipPanel(side=PORT, thrusters=[t]))
    assert t.status_report["power_consumption"] == t.power_consumption, \
        "Thruster power_consumption is innacurately reported"
Exemple #5
0
def test_is_active_status_report_no_power():
    thruster = Thruster(max_force=15)
    Ship(port_panel=ShipPanel(side=PORT, thrusters=[thruster]))
    thruster.powered_on = False
    assert thruster.status_report["is_active"] == thruster.is_active, \
        "Thruster is_active is innacurately reported"
Exemple #6
0
def test_mass_status_report():
    thruster = Thruster(max_force=15)
    Ship(port_panel=ShipPanel(side=PORT, thrusters=[thruster]))
    assert thruster.status_report["mass"] == thruster.mass, \
        "Thruster mass is innacurately reported"
Exemple #7
0
def test_low_integrity_status_report():
    thruster = Thruster(max_force=15)
    Ship(port_panel=ShipPanel(side=PORT, thrusters=[thruster]))
    thruster.degrade(0.5)
    assert thruster.status_report["integrity"] == thruster.integrity, \
        "Thruster integrity is innacurately reported"
Exemple #8
0
def test_is_active_status_report_no_integrity():
    thruster = Thruster(max_force=15)
    Ship(port_panel=ShipPanel(side=PORT, thrusters=[thruster]))
    thruster.degrade(1)
    assert thruster.status_report["is_active"] == thruster.is_active, \
        "Thruster is_active is innacurately reported"
Exemple #9
0
def test_current_acceleration_status_report_high_max_force():
    t = Thruster(max_force=150)
    Ship(port_panel=ShipPanel(side=PORT, thrusters=[t]))
    assert t.status_report["current_acceleration"] == t.current_acceleration, \
        "Thruster current_acceleration is innacurately reported"
Exemple #10
0
def test_current_acceleration_status_report_lothruster_throttle():
    t = Thruster(max_force=15)
    Ship(port_panel=ShipPanel(side=PORT, thrusters=[t]))
    t.throttle = 0.2
    assert t.status_report["current_acceleration"] == t.current_acceleration, \
        "Thruster current_acceleration is innacurately reported"
Exemple #11
0
def test_max_force_status_report_lothruster_integrity():
    thruster = Thruster(max_force=15)
    Ship(port_panel=ShipPanel(side=PORT, thrusters=[thruster]))
    thruster.degrade(0.2)
    assert thruster.status_report["max_force"] == thruster.max_force, \
        "Thruster max_force is innacurately reported"
Exemple #12
0
def test_degredation_rate_status_report_high_throttle():
    t = Thruster(max_force=15)
    Ship(port_panel=ShipPanel(side=PORT, thrusters=[t]))
    t.throttle = 1.2
    assert t.status_report["degredation_rate"] == t.degredation_rate, \
        "Thruster degredation_rate is innacurately reported"
Exemple #13
0
def test_direction_status_report():
    thruster = Thruster(max_force=15)
    Ship(port_panel=ShipPanel(side=PORT, thrusters=[thruster]))
    assert thruster.status_report["direction"] == thruster.direction, \
        "Thruster direction is innacurately reported"