Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
joocer committed Mar 31, 2023
1 parent 968cdfc commit fc3b6b2
Show file tree
Hide file tree
Showing 4 changed files with 63 additions and 148 deletions.
2 changes: 0 additions & 2 deletions opteryx/third_party/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,4 @@ These modules have been removed from the codebase
- [**bintrees**](https://github.com/mozman/bintrees)
- [**accumulation_tree**](https://github.com/tkluck/accumulation_tree)
- [**pyudorandom**](https://github.com/mewwts/pyudorandom)
- [**sketch**](https://github.com/dnbaker/sketch)
- [**tdigest**](https://github.com/CamDavidsonPilon/tdigest)
- [**uintset**](https://github.com/standupdev/uintset/)
67 changes: 0 additions & 67 deletions opteryx/third_party/travers/tests/graph_data.py

This file was deleted.

68 changes: 63 additions & 5 deletions opteryx/third_party/travers/tests/test_graph.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,69 @@
import os
import sys

sys.path.insert(1, os.path.join(sys.path[0], ".."))
from opteryx.third_party.travers.tests.graph_data import (
build_graph,
graph_is_as_expected,
)
sys.path.insert(1, os.path.join(sys.path[0], "../../../.."))


def build_graph():
"""
Create a graph for testing
"""
from opteryx.third_party.travers import Graph

g = Graph()

g.add_node("Bindoon", {"node_type": "Locality"})
g.add_node("Gingin", {"node_type": "Locality"})
g.add_node("Toodyay", {"node_type": "Locality"})

g.add_node("Sharlene", {"node_type": "Person"})
g.add_node("Ceanne", {"node_type": "Person"})
g.add_node("Lainie", {"node_type": "Person"})

g.add_node("Hungry Jacks", {"node_type": "Restaurant"})
g.add_node("Chicken Treat", {"node_type": "Restaurant"})
g.add_node("Kailis Bros", {"node_type": "Restaurant"})

g.add_node("Saturn", {"node_type": "Planet"})

g.add_edge("Sharlene", "Bindoon", "Lives In")
g.add_edge("Ceanne", "Gingin", "Lives In")
g.add_edge("Lainie", "Toodyay", "Lives In")

g.add_edge("Hungry Jacks", "Bindoon", "Located In")
g.add_edge("Hungry Jacks", "Gingin", "Located In")
g.add_edge("Chicken Treat", "Gingin", "Located In")
g.add_edge("Chicken Treat", "Toodyay", "Located In")
g.add_edge("Kailis Bros", "Toodyay", "Located In")

g.add_edge("Sharlene", "Ceanne", "Sister")
g.add_edge("Ceanne", "Sharlene", "Sister")
g.add_edge("Sharlene", "Lainie", "Daughter")
g.add_edge("Ceanne", "Lainie", "Daughter")
g.add_edge("Lainie", "Sharlene", "Mother")
g.add_edge("Lainie", "Ceanne", "Mother")

g.add_edge("Sharlene", "Hungry Jacks", "Likes")
g.add_edge("Ceanne", "Kailis Bros", "Likes")
g.add_edge("Lainie", "Kailis Bros", "Likes")

return g


def graph_is_as_expected(graph):
assert sorted(graph.nodes()) == [
"Bindoon",
"Ceanne",
"Chicken Treat",
"Gingin",
"Hungry Jacks",
"Kailis Bros",
"Lainie",
"Saturn",
"Sharlene",
"Toodyay",
]
assert len(list(graph.edges())) == 17


def test_graph():
Expand Down
74 changes: 0 additions & 74 deletions opteryx/third_party/travers/tests/test_graph_details.py

This file was deleted.

0 comments on commit fc3b6b2

Please sign in to comment.