Ejemplo n.º 1
0
 def setUp(self):
     self.context = open_dependency_context(supply_fs=True,
                                            supply_logging=True)
     self.context.inject(StreamHandler, EmptyFake())
     EventBroker.reset()
     subscribe_event_handlers(self)
     self.skip_events = 0
Ejemplo n.º 2
0
 def __init__(self):
     self._log = dependency(logger_for_module)(__name__)
     config = config_for_module(__name__)
     self.element_find_timeout = config.browser_element_find_timeout
     self.page_load_timeout = config.browser_page_load_timeout
     self._driver = dependency(launch_browser)()
     self._failure_detected = False
     subscribe_event_handlers(self)
 def setUp(self):
     close_all_dependency_contexts()
     EventBroker.reset()
     subscribe_event_handlers(self)
     self.suite_name = "EarElephant"
     self.xml_report = None
     self.compiler = ResultCompiler()
     self.compiler.activate()
     self.sut = JunitReporter()
     self.sut.activate()
Ejemplo n.º 4
0
    def test_ignores_method_not_starting_with_on(self):
        class Thing:
            def __init__(self):
                self.was_called = False

            def test_skipped(self, **kwargs):
                self.was_called = True

        thing = Thing()
        subscribe_event_handlers(thing)
        EventBroker.publish(event=TestEvent.test_skipped)
        assert not thing.was_called, "Handler was detected inapproprately"
Ejemplo n.º 5
0
    def test_subscribes_recognized_handler_to_matching_event(self):
        class Thing:
            def __init__(self):
                self.was_called = False

            def on_test_skipped(self, **kwargs):
                self.was_called = True

        thing = Thing()
        subscribe_event_handlers(thing)
        EventBroker.publish(event=TestEvent.test_skipped)
        assert thing.was_called, "Subscriber was not called"
Ejemplo n.º 6
0
 def setUp(self):
     self.context = open_dependency_context(supply_env=True,
                                            supply_fs=True,
                                            supply_logging=True)
     self.context.inject(StreamHandler, EmptyFake())
     EventBroker.reset()
     subscribe_event_handlers(self)
     self.skip_events = 0
     self.skip_msg = "intentional"
     self.suite_teardown_ran = False
     self.test_setup_ran = False
     self.test_teardown_ran = False
Ejemplo n.º 7
0
 def __init__(self):
     subscribe_event_handlers(self)
     config = config_for_module(__name__)
     log = logger_for_module(__name__)
     self._proxies = {}
     if config.http_proxy:
         proxy = config.http_proxy
         self._proxies["http"] = proxy
         log.debug(f"Using HTTP proxy {proxy}")
     if config.https_proxy:
         proxy = config.https_proxy
         self._proxies["https"] = proxy
         log.debug(f"(Using HTTPS proxy {proxy}")
     self._exception_callbacks = {}
     self._logger = logger_for_module(__name__)
     self._session = None
     self._persistent_headers = {}
     self._transcript = Transcript()
     self._verify_certs = config.https_verify_certs
     log.debug(f"Socket timeout: {self._socket_timeout()}")
Ejemplo n.º 8
0
 def attempt():
     subscribe_event_handlers(Thing())
Ejemplo n.º 9
0
 def activate(self):
     subscribe_event_handlers(self)
Ejemplo n.º 10
0
 def setUp(self):
     self.context = open_dependency_context(supply_logging=True)
     EventBroker.reset()
     subscribe_event_handlers(self)
     disable_default_reporters()