Esempio n. 1
0
def test_no_time():
    TestSystem = AuxSystem(10, 6)
    assert (TestSystem.energy_consumed(0, 10, 6) == 0)
Esempio n. 2
0
def test_positive_attributes():
    TestSystem = AuxSystem(1, 1)
    assert (TestSystem.energy_consumed(1, 1, 1) == 1)
Esempio n. 3
0
def test_attributes_initialized_negative():
    TestSystem = AuxSystem(-1, -1)
    assert (TestSystem.voltage == 0)
    assert (TestSystem.voltage_old == 0)
    assert (TestSystem.current == 0)
    assert (TestSystem.current_old == 0)
Esempio n. 4
0
def test_negative_current():
    # will assume new current is 0
    TestSystem = AuxSystem(10, 0)
    assert (TestSystem.energy_consumed(2, -1, 2) == 20)
Esempio n. 5
0
def test_negative_voltage():
    # will assume new voltage is 0
    TestSystem = AuxSystem(10, 6)
    assert (TestSystem.energy_consumed(1, 10, -1) == 60)
Esempio n. 6
0
def test_negative_time():
    TestSystem = AuxSystem(10, 6)
    assert (TestSystem.energy_consumed(-1, 10, 6) == 0)
Esempio n. 7
0
def test_no_voltage():
    TestSystem = AuxSystem(2, 0)
    assert (TestSystem.energy_consumed(1, 2, 0) == 0)
Esempio n. 8
0
def test_no_current():
    TestSystem = AuxSystem(0, 2)
    assert (TestSystem.energy_consumed(1, 0, 2) == 0)