예제 #1
0
    def test_evaluation_of_queue_settings(self):
        settings = Settings(queue=LIFO())

        simulation = Simulation(InMemoryDataStorage(None))
        simulation.evaluate(settings)

        task_pool = simulation.environment.look_up(
            Symbols.QUEUE).delegate.delegate.delegate
        self.assertIsInstance(task_pool, LIFOTaskPool)
 def setUp(self):
     self.factory = Factory()
     self.storage = InMemoryDataStorage(None)
     self.storage._log = MagicMock(Log)
     self.simulation = self.factory.create_simulation(self.storage)
     service = MagicMock()
     service.name = self.CALLER
     self.simulation.environment.define(Symbols.SELF, service)
     self.simulation.environment.define(Symbols.LISTENER, MagicMock(Dispatcher))
     self.logger = Logger(self.simulation.environment)
예제 #3
0
    def test_evaluation_of_autoscaling_settings(self):
        PERIOD = 23
        settings = Settings(autoscaling=Autoscaling(PERIOD, limits=(3, 5)))

        simulation = Simulation(InMemoryDataStorage(None))
        simulation.evaluate(settings)

        autoscaler = simulation.environment.look_up(Symbols.AUTOSCALING)

        self.assertIsInstance(autoscaler, AutoScaler)
        self.assertEqual(PERIOD, autoscaler.period)
        self.assertEqual((3, 5), autoscaler.limits)
예제 #4
0
 def setUp(self):
     self.simulation = Simulation(InMemoryDataStorage(None))
예제 #5
0
 def evaluate(self, expression):
     simulation = Simulation(InMemoryDataStorage(None))
     simulation.evaluate(expression)
     return simulation
 def setUp(self):
     self.factory = Factory()
     self.storage = InMemoryDataStorage(None)
     self.simulation = self.factory.create_simulation(self.storage)
예제 #7
0
 def __init__(self):
     self.simulation = Simulation(InMemoryDataStorage(None))