コード例 #1
0
ファイル: test_install.py プロジェクト: appbootup/nephos-1
 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()
コード例 #2
0
ファイル: test_install.py プロジェクト: praveendhac/nephos
 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()
コード例 #3
0
ファイル: test_install.py プロジェクト: appbootup/nephos-1
 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")
コード例 #4
0
ファイル: test_install.py プロジェクト: praveendhac/nephos
 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'})