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

Add tests for sparql_status without queryid #339

Merged
merged 1 commit into from
Jul 22, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions test/integration/iam/sparql/test_sparql_status_with_iam.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,16 @@ def test_do_sparql_status_nonexistent(self):
assert status_res.status_code == 200
assert status_res.content == b''

@pytest.mark.iam
@pytest.mark.neptune
def test_do_sparql_status_empty(self):
query_id = ""
status_response_fields = [b"acceptedQueryCount", b"runningQueryCount", b"queries"]
status_res = self.client.sparql_status(query_id)
assert status_res.status_code == 200
for field in status_response_fields:
assert field in status_res.content

@pytest.mark.iam
@pytest.mark.neptune
def test_do_sparql_cancel_nonexistent(self):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,19 @@ def test_sparql_query_explain(self):
self.assertTrue(sparql_res.startswith('<!DOCTYPE html>'))
self.assertTrue('</table>' in sparql_res)

@pytest.mark.skip(reason="Line magics don't use user_ns; fix this when we figure out where store-to is being saved")
@pytest.mark.jupyter
@pytest.mark.sparql
@pytest.mark.neptune
def test_sparql_status(self):
store_to_var = 'sparql_status_res'
status_response_fields = ["acceptedQueryCount", "runningQueryCount", "queries"]
self.ip.run_line_magic('sparql_status', f'--store-to {store_to_var}')
self.assertFalse('graph_notebook_error' in self.ip.user_ns)
sparql_status_res = self.ip.user_ns[store_to_var]
for field in status_response_fields:
assert field in sparql_status_res

@pytest.mark.jupyter
def test_load_sparql_config(self):
config = '''{
Expand Down