def test_composer_connection_again(self, mock_cm_create, mock_cm_read, mock_ingress_read, mock_json_ct): mock_cm_read.side_effect = [{"connection.json": "cm-data"}] composer_connection(self.OPTS, verbose=True) mock_ingress_read.assert_called_once_with("peer-ca-hlf-ca", namespace="ca-namespace") mock_cm_read.assert_called_once_with("connection-secret", "peer-namespace") mock_json_ct.assert_not_called() mock_cm_create.assert_not_called()
def test_composer_connection_again(self, mock_cm_create, mock_cm_read, mock_ingress_read, mock_json_ct): mock_cm_read.side_effect = [{'connection.json': 'cm-data'}] composer_connection(self.OPTS, verbose=True) mock_ingress_read.assert_called_once_with('peer-ca-hlf-ca', namespace='peer-namespace', verbose=True) mock_cm_read.assert_called_once_with('connection-secret', 'peer-namespace', verbose=True) mock_json_ct.assert_not_called() mock_cm_create.assert_not_called()
def test_composer_connection(self, mock_cm_create, mock_cm_read, mock_ingress_read, mock_json_ct): mock_cm_read.side_effect = [ApiException] mock_json_ct.side_effect = ["cm-data"] composer_connection(self.OPTS) mock_ingress_read.assert_called_once_with("peer-ca-hlf-ca", namespace="ca-namespace") mock_cm_read.assert_called_once_with("connection-secret", "peer-namespace") mock_json_ct.assert_called_once() mock_cm_create.assert_called_once_with({"connection.json": "cm-data"}, "connection-secret", "peer-namespace")
def test_composer_connection(self, mock_cm_create, mock_cm_read, mock_ingress_read, mock_json_ct): mock_cm_read.side_effect = [ApiException] mock_json_ct.side_effect = ['cm-data'] composer_connection(self.OPTS) mock_ingress_read.assert_called_once_with('peer-ca-hlf-ca', namespace='peer-namespace', verbose=False) mock_cm_read.assert_called_once_with('connection-secret', 'peer-namespace', verbose=False) mock_json_ct.assert_called_once() mock_cm_create.assert_called_once_with('peer-namespace', 'connection-secret', {'connection.json': 'cm-data'})