def test_import_cert(self): ''' Test - Import the certificate file into the given certificate store. ''' kwargs = {'name': CERT_PATH} mock_value = MagicMock(return_value=CERT_PATH) with patch.dict(win_pki.__salt__, {'cp.cache_file': mock_value}): self.assertTrue(win_pki.import_cert(**kwargs))
def test_import_cert(self): ''' Test - Import the certificate file into the given certificate store. ''' kwargs = {'name': CERT_PATH} mock_value = MagicMock(return_value=CERT_PATH) with patch.dict(win_pki.__salt__, {'cp.cache_file': mock_value}), \ patch('salt.modules.win_pki._cmd_run', MagicMock(return_value=JSON_CERTS)), \ patch('salt.modules.win_pki._validate_cert_path', MagicMock(return_value=None)), \ patch('salt.modules.win_pki.get_cert_file', MagicMock(return_value=CERTS[THUMBPRINT])), \ patch('salt.modules.win_pki.get_certs', MagicMock(return_value=CERTS)): self.assertTrue(win_pki.import_cert(**kwargs))
def test_import_cert(self): """ Test - Import the certificate file into the given certificate store. """ kwargs = {"name": CERT_PATH} mock_value = MagicMock(return_value=CERT_PATH) with patch.dict(win_pki.__salt__, {"cp.cache_file": mock_value}), patch( "salt.modules.win_pki._cmd_run", MagicMock(return_value=JSON_CERTS)), patch( "salt.modules.win_pki._validate_cert_path", MagicMock(return_value=None)), patch( "salt.modules.win_pki.get_cert_file", MagicMock(return_value=CERTS[THUMBPRINT]), ), patch("salt.modules.win_pki.get_certs", MagicMock(return_value=CERTS)): self.assertTrue(win_pki.import_cert(**kwargs))