def test_it_ignores_already_processed_exception_for_static_data(self): # Arrange self.orchestrator.process.side_effect = AlreadyProcessed # Act driver = Driver(*self.init_args) driver.on_call(fake('FrameDigest'))
def test_start_creates_thread_scoped_tracer(self): # Arrange nothing driver = Driver(*self.init_args) # Act driver.start() # Assert self.thread_scoped_tracer.start.assert_called_once_with()
def test_stop_stops_thread_scoped_tracer(self): # Arrange driver = Driver(*self.init_args) driver.start() # Act driver.stop() # Assert self.thread_scoped_tracer.stop.assert_called_once_with()
def test_it_processes_static_data_for_each_call(self): # Arrange frame_digest = fake('FrameDigest') frame_digest.function_name = 'fake_function_name' frame_digest.file_name = 'fake_file_name' frame_digest.line_number = 1 # Act driver = Driver(*self.init_args) driver.on_call(frame_digest) # Assert self.orchestrator.process.assert_called_once_with('fake_file_name')
def test_on_call_notifies_function_call_to_the_observer(self): # Arrange frame_digest = fake('FrameDigest', spec_set=False) expected_function_call = real('FunctionCall') self.function_call_modeler.on_call.return_value = expected_function_call # Act driver = Driver(*self.init_args) driver.on_call(frame_digest) # Assert self.observer.on_call.assert_called_once_with(ANY) actual_function_call = self.observer.on_call.call_args[0][0] assert_equal(actual_function_call.function, expected_function_call.function)
def __init__(self, base_path, callback): self.async_publisher = AsyncPublisher(callback) self.model = ObservableModel(self.async_publisher) entity_id_generator = EntityIdGenerator(base_path) modeling_orchestrator = Orchestrator(base_path, self.model) self.dynamic_modeling_driver = DynamicModelingDriver(self, entity_id_generator, modeling_orchestrator)