def test_config_001_10_events_two() -> None:
    config_file = open('input_files/config_001_10.json')
    sim = GroceryStoreSimulation(config_file)
    config_file.close()
    event_file = open('input_files/events_two.txt')
    sim_stats = sim.run(event_file)
    event_file.close()
    assert sim_stats == {'num_customers': 2, 'total_time': 31, 'max_wait': 21}
def test_config_111_10_events_mixtures() -> None:
    config_file = open('input_files/config_111_10.json')
    sim = GroceryStoreSimulation(config_file)
    config_file.close()
    event_file = open('input_files/events_mixtures.txt')
    sim_stats = sim.run(event_file)
    event_file.close()
    assert sim_stats == {
        'num_customers': 16,
        'total_time': 390,
        'max_wait': 266
    }
def test_simulation() -> None:
    """Test two events and single checkout simulation."""
    gss = GroceryStoreSimulation(StringIO(CONFIG_FILE))
    stats = gss.run(StringIO(EVENT_FILE))
    assert stats == {'num_customers': 2, 'total_time': 18, 'max_wait': 8}
예제 #4
0
 def test(self):
     sim = GroceryStoreSimulation(config)
     stats = sim.run(events)
     self.assertEqual(stats['max_wait'], max_wait)
예제 #5
0
 def test(self):
     sim = GroceryStoreSimulation(config)
     stats = sim.run(events)
     self.assertEqual(stats['total_time'], total_time)
예제 #6
0
 def test(self):
     sim = GroceryStoreSimulation(config)
     stats = sim.run(events)
     self.assertEqual(stats['num_customers'], num_customers)
예제 #7
0
 def test(self):
     sim = GroceryStoreSimulation(config)
     stats = sim.run(events)
     self.assertEqual(stats['max_wait'], max_wait)
예제 #8
0
 def test(self):
     sim = GroceryStoreSimulation(config)
     stats = sim.run(events)
     self.assertEqual(stats['total_time'], total_time)
예제 #9
0
 def test(self):
     sim = GroceryStoreSimulation(config)
     stats = sim.run(events)
     self.assertEqual(stats['num_customers'], num_customers)