Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use patches on tests #207

Closed
c-martinez opened this issue Jun 20, 2019 · 2 comments
Closed

Use patches on tests #207

c-martinez opened this issue Jun 20, 2019 · 2 comments

Comments

@c-martinez
Copy link
Collaborator

The test_sparql_transformer test, relies on response from dbpedia:

grlc/tests/test_gquery.py

Lines 208 to 219 in f5664e3

def test_sparql_transformer(self):
rq, _ = self.loader.getTextForName('test-json')
endpoint, _ = gquery.guess_endpoint_uri(rq, self.loader)
self.assertEqual('http://dbpedia.org/sparql', endpoint, 'Should match endpoint in test-json.json')
resp, status, headers = utils.dispatchSPARQLQuery(rq, self.loader, content=None, requestArgs={},
acceptHeader='application/json',
requestUrl='http://', formData={})
self.assertEqual(status, 200)
self.assertIsInstance(resp, list)
self.assertIn('id', resp[0])

This means that if you are not connected to the internet, it is not possible to run this test. One way to work around this is to use @patch (as done in test_get_enumeration test) to mock the http request.

@pasqLisena -- could you possibly have a look at this test?

@pasqLisena
Copy link
Contributor

pasqLisena commented Jul 2, 2019

Hi @c-martinez . I can give a look at this next week.

pasqLisena added a commit to pasqLisena/grlc that referenced this issue Jul 11, 2019
@c-martinez
Copy link
Collaborator Author

Closed by #216

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants