Skip to content

Commit 2019707

Browse files
committed
Adding the integration tests
1 parent 7d143d4 commit 2019707

File tree

4 files changed

+62
-0
lines changed

4 files changed

+62
-0
lines changed

tests/e2e/project/node-ttls.yaml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
- implementation: nodestream.pipeline.extractors:TimeToLiveConfigurationExtractor
2+
arguments:
3+
graph_object_type: NODE
4+
configurations:
5+
- object_type: Airport
6+
expiry_in_hours: 0
7+
- object_type: Country
8+
expiry_in_hours: 0
9+
- object_type: Region
10+
expiry_in_hours: 0
11+
- object_type: Player
12+
expiry_in_hours: 0
13+
- object_type: PlaceOfOrigin
14+
expiry_in_hours: 0
15+
- object_type: Position
16+
expiry_in_hours: 0
17+
- object_type: Team

tests/e2e/project/nodestream.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,10 @@ scopes:
55
name: airports
66
- path: tests/e2e/project/fifa_2021_player_data.yaml
77
name: fifa
8+
- path: tests/e2e/project/node-ttls.yaml
9+
name: node-ttls
10+
- path: tests/e2e/project/node-ttls.yaml
11+
name: relationship-ttls
812

913
targets:
1014
my-neo4j-db:
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
- implementation: nodestream.pipeline.extractors:TimeToLiveConfigurationExtractor
2+
arguments:
3+
graph_object_type: RELATIONSHIP
4+
configurations:
5+
- object_type: WITHIN
6+
expiry_in_hours: 0
7+
- object_type: ORIGINATES_FROM
8+
expiry_in_hours: 0
9+
- object_type: LINES_UP_AT
10+
expiry_in_hours: 0
11+
- object_type: PLAYS_FOR
12+
expiry_in_hours: 0

tests/e2e/test_neo4j_pipelines.py

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,33 @@ def validate_fifa_mo_club(session):
5959
assert result.single()["club"] == "Liverpool"
6060

6161

62+
def validate_relationship_ttls(session):
63+
result = session.run(
64+
"""
65+
MATCH ()-[r]-()
66+
RETURN count(r) as relationship_count
67+
"""
68+
)
69+
assert result.single()["relationship_count"] == 0
70+
result = session.run(
71+
"""
72+
MATCH (n)
73+
RETURN count(n) as node_count
74+
"""
75+
)
76+
assert result.single()["relationship_count"] != 0
77+
78+
79+
def validate_node_ttls(session):
80+
result = session.run(
81+
"""
82+
MATCH (n)
83+
RETURN count(n) as node_count
84+
"""
85+
)
86+
assert result.single()["node_count"] == 0
87+
88+
6289
@pytest.mark.asyncio
6390
@pytest.mark.e2e
6491
@pytest.mark.parametrize("neo4j_version", TESTED_NEO4J_VERSIONS)
@@ -67,6 +94,8 @@ def validate_fifa_mo_club(session):
6794
[
6895
("airports", [validate_airports, valiudate_airport_country]),
6996
("fifa", [validate_fifa_player_count, validate_fifa_mo_club]),
97+
("relatiobship-ttls", [validate_relationship_ttls]),
98+
("node-ttls", [validate_node_ttls]),
7099
],
71100
)
72101
async def test_neo4j_pipeline(

0 commit comments

Comments
 (0)