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()
class Trace(object): 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) def start(self): self.async_publisher.start() self.dynamic_modeling_driver.start() def stop(self): self.dynamic_modeling_driver.stop() self.async_publisher.stop()