def test_random_arrival_generator_zero() -> None: """Test the random arrival generator for two rounds: 0 and 5. Note that this test just checks that the range of possible values for the random people are correct. """ max_floor = 5 num_per_round = 2 random_generator = RandomArrivals(max_floor, num_per_round) for round_num in [0, 5]: arrivals = random_generator.generate(round_num) all_people = [] for floor, people in arrivals.items(): # Check that the floor is in the correct range. assert 1 <= floor <= max_floor all_people.extend(people) # Check that the right number of people were generated. assert len(all_people) == num_per_round for p in all_people: # Check floor boundaries assert 1 <= p.start <= max_floor assert 1 <= p.target <= max_floor # Check that the start and target floors are different. assert p.start != p.target
def test_random_arrival_generator_zero() -> None: """Test the random arrival generator for two rounds: 0 and 5. Note that this test just checks that the range of possible values for the random people are correct. """ max_floor = 5 num_per_round = 0 random_generator = RandomArrivals(max_floor, num_per_round) for round_num in [0, 5]: arrivals = random_generator.generate(round_num) all_people = [] for floor, people in arrivals.items(): # Check that the floor is in the correct range. assert 0 <= floor <= max_floor all_people.extend(people) # Check that the right number of people were generated. assert len(all_people) == 0 assert all_people == []