Exemplo n.º 1
0
    def test_package_error(self):

        config_path = os.path.join(here, "test_configs", "error", "config")
        package = PackageManager(config_path)
        package.run_package(log_run_to_db=False)

        assert package._script_thread.script_exceptioned == True
Exemplo n.º 2
0
    def test_package_timeout(self):

        config_path = os.path.join(here, "test_configs", "timeout", "config")
        package = PackageManager(config_path)
        package.run_package(log_run_to_db=False)

        assert package._script_thread.script_timed_out == True
Exemplo n.º 3
0
    def test_package_success(self):

        config_path = os.path.join(here, "test_configs", "success", "config")
        package = PackageManager(config_path)
        package.run_package(log_run_to_db=False)

        assert package._script_thread.script_exceptioned == False
        assert package._script_thread.script_timed_out == False
Exemplo n.º 4
0
    def test_email_on_error(self, monkeypatch):
        config_path = os.path.join(here, "test_configs", "error", "config")
        package = PackageManager(config_path)
        package.run_package(log_run_to_db=False)

        def mockreturn():
            return True

        monkeypatch.setattr(package, "send_notification_email", mockreturn)