Beispiel #1
0
 def execute(self, driver, config):
     logging.debug("Executing Action %s" % self.name)
     # if not self.start_state.is_state_present(driver):
     #     result =Result(step_results=self.execution_results,passed=False,message="State %s not present" % self.start_state)
     #     result.failed_state = self.start_state
     #     result.actual_state = self.start_state.get_current_state(driver)
     #     result.actual_state.save()
     #     result.html = driver.html
     #     result.screenshot = driver.get_screenshot_as_base64()
     #     return result
     result = Executable.execute(self, driver, config)
     if not result.passed:
         result.failed_state = self.start_state
         result.actual_state = self.start_state.get_current_state(driver)
         result.actual_state.save()
         result.html = driver.html
         result.screenshot = driver.get_screenshot_as_base64()
     return result
 def test_call_bundle(self):
     jekyll = Executable("jekyll")
     bundle = Executable("bundle", "exec", jekyll)
     self.assertListEqual(bundle.cmd, ["bundle", "exec"] + jekyll.cmd)
    def test_executable_error(self):
        e = Executable("test")
        with self.assertRaises(ExecutableError) as context:
            e.call()

        self.assertTrue(context.exception.return_code == 1)
 def test_call_success(self):
     date = Executable("date")
     self.assertTrue(date.call().return_code() == 0)
 def test_add_arguments(self):
     e = Executable("test", "param1", "param2")
     e.add_parameter("param3")
     self.assertListEqual(e.cmd, ["test", "param1", "param2", "param3"])
 def test_nested_cmd(self):
     e = Executable("test", "param1", "param2")
     f = Executable("wrapper", "around", e)
     self.assertListEqual(f.cmd, ["wrapper", "around"] + e.cmd)
 def test_single_cmd(self):
     e = Executable("test", "param1", "param2")
     self.assertListEqual(e.cmd, ["test", "param1", "param2"])
Beispiel #8
0
 def execute(self, driver, config):
     logging.debug("Executing Test %s" % self.name)
     self.steps = self.actions
     suite_results = Executable.execute(self, driver, config)
     return suite_results
Beispiel #9
0
    def test_add_parameter_executable(self):
        j = Jekyll()
        e = Executable("test", "executable", "with", "parameters")

        j.add_parameter(e)
        self.assertListEqual(j.cmd, ["jekyll", "build"] + e.cmd)