コード例 #1
0
ファイル: install_tests.py プロジェクト: danielra/sprinter
 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)
コード例 #2
0
ファイル: test_install.py プロジェクト: GreenGremlin/sprinter
 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)
コード例 #3
0
ファイル: test_install.py プロジェクト: GreenGremlin/sprinter
 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)
コード例 #4
0
 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)
コード例 #5
0
 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)
コード例 #6
0
ファイル: install_tests.py プロジェクト: tmckay/sprinter
 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)