def test_get_composer_data_exception(self, mock_get_app_info): mock_get_app_info.side_effect = [ValueError] with pytest.raises(ValueError): get_composer_data(self.OPTS, verbose=True) mock_get_app_info.assert_called_once_with("peer-namespace", "hlc-hl-composer-rest", "hlc-hl-composer-rest", secret_key="COMPOSER_APIKEY")
def test_get_composer_data(self, mock_get_app_info): mock_get_app_info.side_effect = [{"api-key": "hlc-key", "url": "an-ingress"}] get_composer_data(self.OPTS) mock_get_app_info.assert_called_once_with( "peer-namespace", "hlc-hl-composer-rest", "hlc-hl-composer-rest", secret_key="COMPOSER_APIKEY", verbose=False, )
def test_get_composer_data(self, mock_get_app_info): mock_get_app_info.side_effect = [{ 'api-key': 'hlc-key', 'url': 'an-ingress' }] get_composer_data(self.OPTS) mock_get_app_info.assert_called_once_with('peer-namespace', 'hlc-hl-composer-rest', 'hlc-hl-composer-rest', secret_key='COMPOSER_APIKEY', verbose=False)