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)
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)
def setUp(self): self.simulation = Simulation(InMemoryDataStorage(None))
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)
def __init__(self): self.simulation = Simulation(InMemoryDataStorage(None))