def _get_api(qe_token, qe_url): """Helper for instantating an IBMQConnector.""" if ('quantum-computing.ibm.com/api' in qe_url and 'auth' in qe_url): raise SkipTest('Classic api URL not provided') return IBMQConnector(qe_token, config={'url': qe_url})
def test_invalid_token(self): """Test using an invalid token""" with self.assertRaises(ApiError): _ = IBMQConnector('INVALID_TOKEN')
def test_url_unreachable(self, qe_token, qe_url): """Test accessing an invalid URL""" # pylint: disable=unused-argument with self.assertRaises(ApiError): _ = IBMQConnector(qe_token, config={'url': 'INVALID_URL'})
def test_url_404(self, qe_token, qe_url): """Test accessing a 404 URL""" url_404 = re.sub(r'/api.*$', '/api/TEST_404', qe_url) with self.assertRaises(ApiError): _ = IBMQConnector(qe_token, config={'url': url_404})
def _get_api(qe_token, qe_url): """Helper for instantating an IBMQConnector.""" return IBMQConnector(qe_token, config={'url': qe_url})
def test_url_unreachable(self, qe_token, qe_url): """Test accessing an invalid URL""" qe_url = 'INVALID_URL' with self.assertRaises(ApiError): _ = IBMQConnector(qe_token, config={'url': qe_url})
def test_invalid_token(self, qe_token, qe_url): """Test using an invalid token""" qe_token = 'INVALID_TOKEN' with self.assertRaises(ApiError): _ = IBMQConnector(qe_token, config={'url': qe_url})
def _get_api(qe_token, qe_url): """Helper for instantating an IBMQConnector.""" if ('quantum-computing.ibm.com/api' in qe_url and 'auth' in qe_url): raise SkipTest('Test needs credentials for classic API') return IBMQConnector(qe_token, config={'url': qe_url})