Skip to content
3 changes: 2 additions & 1 deletion tests/test_core.py
Original file line number Diff line number Diff line change
Expand Up @@ -236,13 +236,14 @@ def test_schedule_at_time(self):
def test_run_until(self):
"""Test running until specific time."""
sim = Simulation()
sim.schedule(lambda: None, delay=101.0) # Need at least one event past end time
sim.run(until=100.0)
assert sim.now == 100.0

def test_run_for_duration(self):
"""Test running for duration."""
sim = Simulation()
sim.schedule(lambda: None, delay=0) # Need at least one event
sim.schedule(lambda: None, delay=51.0) # Need at least one event past end time
sim.run(for_duration=50.0)
assert sim.now == 50.0

Expand Down
4 changes: 2 additions & 2 deletions tests/test_resources.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"""

import pytest
from simcraft.core.simulation import Simulation
from simcraft.core.simulation import Simulation, SimulationConfig
from simcraft.core.entity import Entity
from simcraft.resources.queue import Queue, PriorityQueue
from simcraft.resources.server import Server
Expand Down Expand Up @@ -258,7 +258,7 @@ def test_queueing(self):

def test_random_service_time(self):
"""Test random service time function."""
sim = Simulation(config={"seed": 42})
sim = Simulation(config=SimulationConfig(seed=42))

def random_service():
return sim.rng.exponential(5.0)
Expand Down