Skip to content

Commit

Permalink
Merge pull request #158 from aidotse/OS-X-CI-Bugs
Browse files Browse the repository at this point in the history
Increased allowed ranges for tests to allow passing tests on slower devices
  • Loading branch information
gomezzz authored Mar 3, 2023
2 parents 5d84682 + f50bcfd commit 3156aa9
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion paseos/tests/activity_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ async def func(args):
# We charge 1W per second
# And discharge 10W per second
# So should be roughly 20W - 6W consumed from starting 500
assert sat1.battery_level_in_Ws > 480 and sat1.battery_level_in_Ws < 490
assert sat1.battery_level_in_Ws > 475 and sat1.battery_level_in_Ws < 490

# test removing the activity
assert "Testing" in sim._activity_manager._activities.keys()
Expand Down
14 changes: 7 additions & 7 deletions paseos/tests/time_multiplier_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ async def test_activity():
# init simulation

cfg = load_default_cfg() # loading cfg to modify defaults
cfg.sim.time_multiplier = 10.0
cfg.sim.time_multiplier = 5.0
sim = paseos.init_sim(sat1, cfg)

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

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

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

# Check activity result
assert test_val[0] == 10
assert test_val[0] == 5

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

0 comments on commit 3156aa9

Please sign in to comment.