Exemplo n.º 1
0
class SetupPyRunnerTest(unittest.TestCase):
    def setUp(self):
        self._tmp_dir = tempfile.mkdtemp()
        url = "https://github.com/audreyr/standardjson"
        self._repo = Repo.clone_from(url, self._tmp_dir)
        self._runner = SetupPyRunner("standardjson", self._tmp_dir)

    def tearDown(self):
        shutil.rmtree(self._tmp_dir)

    def test_run(self):
        out, err = self._runner.run()
        # self.assertFalse("error" in err.lower())
        self.assertTrue("passed" in out.lower())

    def test_run_no_setup_py(self):
        runner = SetupPyRunner("test", "test")
        result = runner.run()
        self.assertIsNone(result)
Exemplo n.º 2
0
 def _instantiate_runner(self) -> AbstractRunner:
     if self._runner_type == RunnerType.PYTEST:
         runner = PyTestRunner(
             self._project_name,
             self._repo_path,
             self._time_limit,
             self._junit_xml_file,
             self._venv_path,
         )
     elif self._runner_type == RunnerType.SETUP_PY:
         runner = SetupPyRunner(self._project_name, self._repo_path,
                                self._time_limit)
     elif self._runner_type == RunnerType.NOSE:
         runner = NoseRunner(self._project_name, self._repo_path,
                             self._time_limit)
     elif self._runner_type == RunnerType.NOSE2:
         runner = Nose2Runner(self._project_name, self._repo_path,
                              self._time_limit)
     else:
         raise IllegalStateException("Could not find a matching runner!")
     return runner
Exemplo n.º 3
0
 def test_run_no_setup_py(self):
     runner = SetupPyRunner("test", "test")
     result = runner.run()
     self.assertIsNone(result)
Exemplo n.º 4
0
 def setUp(self):
     self._tmp_dir = tempfile.mkdtemp()
     url = "https://github.com/audreyr/standardjson"
     self._repo = Repo.clone_from(url, self._tmp_dir)
     self._runner = SetupPyRunner("standardjson", self._tmp_dir)