def test_install_environment(self, environment): """ Test if install calls the proper methods """ args = ['install', 'http://www.google.com'] calls = [call(logging_level=logging.INFO, ignore_errors=False), call().install()] parse_args(args, Environment=environment) environment.assert_has_calls(calls)
def test_errors(self, environment): """ Test if validate catches an invalid manifest """ config = {"validate_manifest.return_value": ["this is funky"]} environment.configure_mock(**config) args = ["validate", self.temp_file_path] calls = [call(logging_level=logging.INFO, ignore_errors=False), call().validate()] parse_args(args, Environment=environment) environment.assert_has_calls(calls)
def test_install_environment(self, environment): """ Test if install calls the proper methods """ with patch("sprinter.core.manifest.load_manifest") as load_manifest: load_manifest.return_value = Mock(spec=Manifest) args = ["install", "http://www.google.com"] calls = [call(logging_level=logging.INFO, ignore_errors=False), call().install()] parse_args(args, Environment=environment) environment.assert_has_calls(calls)
def test_errors(self, environment): """ Test if validate catches an invalid manifest """ config = {'validate_manifest.return_value': ['this is funky']} environment.configure_mock(**config) args = ['validate', self.temp_file_path] calls = [call(logging_level=logging.INFO, ignore_errors=False), call().validate()] parse_args(args, Environment=environment) environment.assert_has_calls(calls)
def test_install_environment(self, environment): """ Test if install calls the proper methods """ with patch('sprinter.core.manifest.load_manifest') as load_manifest: load_manifest.return_value = Mock(spec=Manifest) args = ['install', 'http://www.google.com'] calls = [call(logging_level=logging.INFO, ignore_errors=False), call().install()] parse_args(args, Environment=environment) environment.assert_has_calls(calls)
def test_errors_(self, environment): """ Test if validate catches an invalid manifest """ config = {'validate_manifest.return_value': ['this is funky']} environment.configure_mock(**config) args = ['validate', self.temp_file_path] calls = [call(logging_level=logging.INFO), call().validate_manifest(self.temp_file_path, username=None, password=None)] parse_args(args, Environment=environment) environment.assert_has_calls(calls)