Skip to content

Commit 3156aa9

Browse files
authored
Merge pull request #158 from aidotse/OS-X-CI-Bugs
Increased allowed ranges for tests to allow passing tests on slower devices
2 parents 5d84682 + f50bcfd commit 3156aa9

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

paseos/tests/activity_test.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ async def func(args):
7070
# We charge 1W per second
7171
# And discharge 10W per second
7272
# So should be roughly 20W - 6W consumed from starting 500
73-
assert sat1.battery_level_in_Ws > 480 and sat1.battery_level_in_Ws < 490
73+
assert sat1.battery_level_in_Ws > 475 and sat1.battery_level_in_Ws < 490
7474

7575
# test removing the activity
7676
assert "Testing" in sim._activity_manager._activities.keys()

paseos/tests/time_multiplier_test.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ async def test_activity():
2323
# init simulation
2424

2525
cfg = load_default_cfg() # loading cfg to modify defaults
26-
cfg.sim.time_multiplier = 10.0
26+
cfg.sim.time_multiplier = 5.0
2727
sim = paseos.init_sim(sat1, cfg)
2828

2929
# Initial power is 500
@@ -34,7 +34,7 @@ async def test_activity():
3434
test_val = [0]
3535

3636
async def func(args):
37-
for _ in range(10):
37+
for _ in range(5):
3838
args[0][0] += 1
3939
await asyncio.sleep(0.2)
4040

@@ -48,12 +48,12 @@ async def func(args):
4848
await wait_for_activity(sim)
4949

5050
# Check activity result
51-
assert test_val[0] == 10
51+
assert test_val[0] == 5
5252

5353
# Check power was depleted as expected
54-
# Activity should run roughly 2s
54+
# Activity should run roughly 1s
5555
# We charge 1W per second
56-
# 1s real time equals 10s simulation
56+
# 1s real time equals 5s simulation
5757
# And discharge 10W per second
58-
# So should be roughly 200W - 20W consumed from starting 500
59-
assert sat1.battery_level_in_Ws > 315 and sat1.battery_level_in_Ws < 325
58+
# So should be roughly 50W - 5W consumed from starting 500
59+
assert sat1.battery_level_in_Ws > 350 and sat1.battery_level_in_Ws <= 455

0 commit comments

Comments
 (0)