示例#1
0
 def test_run_all_app_or_lib_suites_app_not_found(
     self,
     fake_lib_get_volumes,
     fake_app_get_volumes,
     fake_repos_by_specs,
     fake_ensure_image,
     fake_expanded_libs,
     fake_get_docker_client,
     fake_initialize_vm,
 ):
     fake_expanded_libs.return_value = self.specs
     with self.assertRaises(KeyError):
         test.run_all_app_or_lib_suites("app-c")
示例#2
0
    def test_run_all_app_or_lib_suites_app_found(
        self,
        fake_exit,
        fake_run_app,
        fake_lib_get_volumes,
        fake_app_get_volumes,
        fake_repos_by_specs,
        fake_ensure_image,
        fake_expanded_libs,
        fake_get_docker_client,
        fake_initialize_vm,
    ):
        fake_expanded_libs.return_value = self.specs
        fake_run_app.return_value = 0

        test.run_all_app_or_lib_suites("app-a")

        fake_run_app.assert_has_calls([call("app-a", "nose", [], should_exit=False)])
        fake_exit.assert_has_calls([call(0)])
示例#3
0
    def test_run_all_app_or_lib_suites_lib_found(
        self,
        fake_exit,
        fake_run_app,
        fake_lib_get_volumes,
        fake_app_get_volumes,
        fake_repos_by_specs,
        fake_ensure_image,
        fake_expanded_libs,
        fake_get_docker_client,
        fake_initialize_vm,
    ):
        fake_expanded_libs.return_value = self.specs
        fake_run_app.side_effect = [0, 1]

        test.run_all_app_or_lib_suites("multi-suite-lib", force_recreate=True)

        fake_run_app.assert_has_calls(
            [
                call("multi-suite-lib", "nose1", [], should_exit=False, force_recreate=True),
                call("multi-suite-lib", "nose2", [], should_exit=False),
            ]
        )
        fake_exit.assert_has_calls([call(1)])