Skip to content

Commit

Permalink
tests added
Browse files Browse the repository at this point in the history
  • Loading branch information
rrmerugu committed Jan 5, 2023
1 parent b9e0c3a commit e268e68
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 9 deletions.
7 changes: 6 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
{
"python.terminal.activateEnvironment": true,
"python.defaultInterpreterPath": "${env:PYTHON_INSTALL_LOC}"
"python.defaultInterpreterPath": "${env:PYTHON_INSTALL_LOC}",
"python.testing.pytestArgs": [
"."
],
"python.testing.unittestEnabled": false,
"python.testing.pytestEnabled": true
}
7 changes: 7 additions & 0 deletions conftest.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import pytest
import os


@pytest.fixture(scope="function")
def gremlin_url() -> str:
return os.environ.get("GREMLIN_SERVER_URL", "ws://megamind.local:8182/gremlin")
16 changes: 8 additions & 8 deletions tests/test_execute_query.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
from invana import InvanaGraph


def test_execute_query():
graph = InvanaGraph("ws://localhost:8182/gremlin")
# response = graph.connector.execute_query("g.addV('person').property('name', 'Rav').next()")
response = graph.connector.execute_query("g.V().limit(1).elementMap().toList()")
print("===================",response.data)
assert response.status_code == 200
assert response.data is not None
graph.close_connection()
class TestConnection:

def test_execute_query(self, gremlin_url: str):
graph = InvanaGraph(gremlin_url)
response = graph.connector.execute_query("g.V().limit(1).elementMap().toList()")
assert response.status_code == 200
assert response.data is not None
graph.close_connection()

0 comments on commit e268e68

Please # to comment.