def test_cacerts_to_secrets_nocacert(self, mock_item_to_secret): mock_item_to_secret.side_effect = [Exception()] with pytest.raises(Exception): cacerts_to_secrets('msp-namespace', './a_dir', 'a-user') mock_item_to_secret.assert_called_once_with( 'msp-namespace', './a_dir', 'a-user', CryptoInfo('cacert', 'cacerts', 'cacert.pem', True), verbose=False)
def test_cacerts_to_secrets(self, mock_item_to_secret): mock_item_to_secret.side_effect = [None, None] cacerts_to_secrets("msp-ns", "./crypto", "a-user") mock_item_to_secret.assert_has_calls( [ call( "msp-ns", "./crypto", "a-user", CryptoInfo("cacert", "cacerts", "cacert.pem", True), verbose=False, ), call( "msp-ns", "./crypto", "a-user", CryptoInfo( "caintcert", "intermediatecerts", "intermediatecacert.pem", False, ), verbose=False, ), ] )
def test_cacerts_to_secrets(self, mock_item_to_secret): mock_item_to_secret.side_effect = [None, None] cacerts_to_secrets('msp-namespace', './a_dir', 'a-user') mock_item_to_secret.assert_has_calls([ call('msp-namespace', './a_dir', 'a-user', CryptoInfo('cacert', 'cacerts', 'cacert.pem', True), verbose=False), call('msp-namespace', './a_dir', 'a-user', CryptoInfo('caintcert', 'intermediatecerts', 'intermediatecacert.pem', False), verbose=False), ])
def test_cacerts_to_secrets_nocacert(self, mock_item_to_secret): mock_item_to_secret.side_effect = [Exception()] with pytest.raises(Exception): cacerts_to_secrets("msp-ns", "./crypto", "a-user") mock_item_to_secret.assert_called_once_with( "msp-ns", "./crypto", "a-user", CryptoInfo("cacert", "cacerts", "cacert.pem", True), )