Skip to content

Commit aa0c2f5

Browse files
committed
Merge branch 'master' of https://github.com/terminusdb/terminusdb-client-python into IncreaseTestCoverage#123
2 parents 5a6b809 + 27146e5 commit aa0c2f5

File tree

3 files changed

+31
-0
lines changed

3 files changed

+31
-0
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ woqlclient/*.egg-info/
2020
coverage.xml
2121
report.xml
2222
.coverage
23+
terminusdb_client_coverage/
2324

2425
*.so
2526
*~

makefile

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,10 @@ flake8:
1818
coverage:
1919
pipenv run py.test terminusdb_client/tests --cov-config .coveragerc --verbose --cov-report term --cov-report xml --cov=terminusdb_client terminusdb_client/tests
2020

21+
# Command to generate a coverage report html
22+
coverage_html:
23+
coverage html -d terminusdb_client_coverage
24+
2125
interrogate:
2226
interrogate -v -I -i -p -s terminusdb_client/woqlclient/woqlClient.py terminusdb_client/woqldataframe/woqlDataframe.py terminusdb_client/woqlquery/woql_query.py terminusdb_client/woqlquery/woql_library.py
2327

terminusdb_client/woqldataframe/woqlDataframe.py

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,36 @@
1515

1616

1717
class EmptyException(Exception):
18+
""" Exception inherited from the built-in Exception Class
19+
20+
Parameters
21+
----------
22+
msg : str
23+
Error message that is describing the exception
24+
25+
Raises
26+
------
27+
EmptyException
28+
If the result table of the query is empty
29+
30+
"""
1831
pass
1932

2033

2134
def _is_empty(query):
35+
"""Checks if the result table of a query is empty
36+
37+
Parameters
38+
----------
39+
query : dict
40+
JSON of the result of the query
41+
42+
Returns
43+
-------
44+
bool
45+
TRUE if the result table is empty, else FALSE
46+
47+
"""
2248
return len(query["bindings"]) == 0
2349

2450

0 commit comments

Comments
 (0)