Example #1
0
 def test_enroll_id_again(self, mock_abspath, mock_execute_until_success,
                          mock_ingress_read, mock_isdir):
     mock_ingress_read.side_effect = [["an-ingress"]]
     mock_isdir.side_effect = [True]
     mock_abspath.side_effect = ["/home/nephos/tls_cert.pem"]
     enroll_id(self.OPTS, "a-ca", "a-peer", "a-password")
     mock_ingress_read.assert_called_once_with("a-ca-hlf-ca",
                                               namespace="ca-namespace")
     mock_isdir.assert_called_once_with("./crypto/a-peer_MSP")
     mock_execute_until_success.assert_not_called()
Example #2
0
 def test_enroll(self, mock_abspath, mock_execute_until_success,
                 mock_ingress_read, mock_isdir):
     mock_ingress_read.side_effect = [["an-ingress"]]
     mock_isdir.side_effect = [False]
     mock_abspath.side_effect = ["/home/nephos/tls_cert.pem"]
     enroll_id(self.OPTS, "a-ca", "a-peer", "a-password")
     mock_ingress_read.assert_called_once_with("a-ca-hlf-ca",
                                               namespace="ca-namespace")
     mock_isdir.assert_called_once_with("./crypto/a-peer_MSP")
     mock_execute_until_success.assert_called_once_with(
         "FABRIC_CA_CLIENT_HOME=./crypto fabric-ca-client enroll " +
         "-u https://a-peer:a-password@an-ingress  -M ./crypto/a-peer_MSP "
         + "--tls.certfiles /home/nephos/tls_cert.pem")