Skip to content

Commit 37e60f6

Browse files
committed
adjust tests, connection default values
1 parent 134dccc commit 37e60f6

File tree

3 files changed

+13
-13
lines changed

3 files changed

+13
-13
lines changed

code_graph/git_utils/git_graph.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,10 @@ class GitGraph():
1212

1313
def __init__(self, name: str):
1414

15-
self.db = FalkorDB(host=os.getenv('FALKORDB_HOST'),
16-
port=os.getenv('FALKORDB_PORT'),
17-
username=os.getenv('FALKORDB_USERNAME'),
18-
password=os.getenv('FALKORDB_PASSWORD'))
15+
self.db = FalkorDB(host=os.getenv('FALKORDB_HOST', 'localhost'),
16+
port=os.getenv('FALKORDB_PORT', 6379),
17+
username=os.getenv('FALKORDB_USERNAME', None),
18+
password=os.getenv('FALKORDB_PASSWORD', None))
1919

2020
self.g = self.db.select_graph(name)
2121

code_graph/graph.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,10 @@ def list_repos() -> List[str]:
99
List processed repositories
1010
"""
1111

12-
db = FalkorDB(host=os.getenv('FALKORDB_HOST'),
13-
port=os.getenv('FALKORDB_PORT'),
14-
username=os.getenv('FALKORDB_USERNAME'),
15-
password=os.getenv('FALKORDB_PASSWORD'))
12+
db = FalkorDB(host=os.getenv('FALKORDB_HOST', 'localhost'),
13+
port=os.getenv('FALKORDB_PORT', 6379),
14+
username=os.getenv('FALKORDB_USERNAME', None),
15+
password=os.getenv('FALKORDB_PASSWORD', None))
1616

1717
graphs = db.list_graphs()
1818
graphs = [g for g in graphs if not g.endswith('_git')]
@@ -25,10 +25,10 @@ class Graph():
2525

2626
def __init__(self, name: str) -> None:
2727
self.name = name
28-
self.db = FalkorDB(host=os.getenv('FALKORDB_HOST'),
29-
port=os.getenv('FALKORDB_PORT'),
30-
username=os.getenv('FALKORDB_USERNAME'),
31-
password=os.getenv('FALKORDB_PASSWORD'))
28+
self.db = FalkorDB(host=os.getenv('FALKORDB_HOST', 'localhost'),
29+
port=os.getenv('FALKORDB_PORT', 6379),
30+
username=os.getenv('FALKORDB_USERNAME', None),
31+
password=os.getenv('FALKORDB_PASSWORD', None))
3232
self.g = self.db.select_graph(name)
3333

3434
# create indicies

tests/test_git_history.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ def test_git_graph_structure(self):
1616
repo_dir = str(repo_dir)
1717

1818
# Build git commit graph
19-
git_graph = build_commit_graph(repo_dir)
19+
git_graph = build_commit_graph(repo_dir, 'git_repo')
2020

2121
# validate git graph structure
2222
repo = Repo(repo_dir)

0 commit comments

Comments
 (0)