Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rc/5.2.0 #763

Merged
merged 85 commits into from
Nov 2, 2023
Merged
Changes from 1 commit
Commits
Show all changes
85 commits
Select commit Hold shift + click to select a range
c322145
Add option to pass driver instead of database_url - WIP
Aug 29, 2023
45177eb
Explictly close the driver in all tests
Sep 5, 2023
fc8aad2
Add explicit connection tests
Sep 5, 2023
88237be
Add test for passing database name
Sep 6, 2023
21e286c
Skip non default database test for community edition
Sep 6, 2023
4cc1569
Update doc
Sep 6, 2023
0d355d2
Reference Connection in Getting Started
Sep 6, 2023
77adfe9
Add test for driver set through config
Sep 6, 2023
c5b3a76
Fix SessionExpired TODO and add notice in docstring
Sep 6, 2023
c2a0961
Merge remote-tracking branch 'origin/master' into task/self-managed-d…
Sep 6, 2023
37327c6
Update README, changelog and version tag
Sep 6, 2023
09c5fa8
Refactor set_connection
Sep 8, 2023
0348fed
Fix default config
Sep 18, 2023
84e3b2d
Improve set_connection docstring
Sep 18, 2023
bac2a0c
Update other core docstrings
Sep 18, 2023
8f7db6e
Add pandas dataframe and series support
Oct 13, 2023
b5f4fde
Update pandas integration doc
Oct 13, 2023
6bb7c90
Fix typo in pandas integration doc
Oct 13, 2023
23c7491
Fix typo in pandas integration docstring
Oct 13, 2023
e3352ba
Add numpy ndarray integration
Oct 13, 2023
d7fda76
Add tests for install/remove labels scripts
Oct 13, 2023
3452614
Fix typo in variable name
curious-broccoli Oct 17, 2023
b263575
Merge branch 'rc/5.1.3' into properties-typo
mariusconjeaud Oct 24, 2023
0840cf9
Merge pull request #758 from curious-broccoli/properties-typo
mariusconjeaud Oct 24, 2023
97b2204
Add relationship unique index for >=5.5 only
Oct 24, 2023
e011daa
Fix Rel class definition
Oct 24, 2023
fa60e5c
Fix version tag for rel constraint
Oct 24, 2023
59c8d42
Merge pull request #759 from neo4j-contrib/task/test-schema-scripts
mariusconjeaud Oct 24, 2023
be434c2
Fix typo in docs
Oct 26, 2023
a6f3730
Fix tests
Oct 26, 2023
b679c52
Add note that self-managed driver is synchronous only
Oct 26, 2023
685b270
Corrected bug in element_id. If the object is initialised but not yet…
aanastasiou Oct 29, 2023
7876b88
Add inspection script
Oct 30, 2023
e62c0fa
Create a database inspection script, with tests
Oct 30, 2023
aa6c4aa
Merge pull request #760 from neo4j-contrib/task/py2neo-alignment
mariusconjeaud Oct 30, 2023
b85dd31
Add docs
Oct 30, 2023
1aaef59
Clean up database before inspection test
Oct 30, 2023
c2ad515
Improve method readability
Oct 30, 2023
9bedf78
Add a temp print to debug remote test
Oct 30, 2023
29dbd04
Try a different set of prints
Oct 30, 2023
740cbdf
Still debugging
Oct 30, 2023
02144d0
Other prints
Oct 30, 2023
d9564e7
Yet another print
Oct 30, 2023
c240aba
YAP
Oct 30, 2023
24acaaf
Other label try
Oct 30, 2023
e959ab6
Remove prints
Oct 30, 2023
1ed6547
Skip console output test for debugging
Oct 30, 2023
0c025ff
Add one print
Oct 30, 2023
fadeaec
Ignore empty lines in console output and test/generated file
Oct 30, 2023
1f1aac5
Add a print for debugging
Oct 30, 2023
50a829d
Add some prints in the script itself
Oct 30, 2023
a0b02aa
Compare prints
Oct 30, 2023
129a5bc
Skip everything except dumping to file and print file content to stdout
Oct 30, 2023
62a43bb
Force test failure to get output in GHA
Oct 30, 2023
9068fed
Try with single node
Oct 30, 2023
909b5d2
Uncomment tests
Oct 30, 2023
309eca8
Pass check True for subprocess
Oct 31, 2023
1f3cdc8
Add APOC to GHA environment
Oct 31, 2023
01049b8
Fix inspection script for 4.4
Oct 31, 2023
e5091c3
Skip relationship type constraints for < 5.7
Oct 31, 2023
bcd84af
Try installating apoc 4.4 for Neo4J 4.4
Oct 31, 2023
14ccb9c
Fix docker script
Oct 31, 2023
764af24
Reset LABS PLUGINS as string
Oct 31, 2023
2dbf738
Revert docker script to unversioned apoc
Oct 31, 2023
d2e5d4b
Fix issue with imports
Oct 31, 2023
4422aef
Fix relationship indexes
Oct 31, 2023
a85ae67
Merge pull request #762 from neo4j-contrib/task/database-introspectio…
mariusconjeaud Oct 31, 2023
450315b
Update APOC and version tag
Oct 31, 2023
ca5498e
Fix unsaved node checks
Oct 31, 2023
133d67f
Merge pull request #761 from aanastasiou/rc/5.1.3
mariusconjeaud Oct 31, 2023
970dae6
Update Changelog and version tag
Oct 31, 2023
4b7335f
Merge remote-tracking branch 'origin/rc/5.2.0' into task/self-managed…
Oct 31, 2023
5750747
Merge pull request #744 from neo4j-contrib/task/self-managed-driver
mariusconjeaud Oct 31, 2023
29c1ffc
Fix typo in Changelog
Nov 2, 2023
acfb62d
Add notice in Changelog about sync driver
Nov 2, 2023
9c1bc4f
Fix code smells
Nov 2, 2023
1d93b9f
Test warning when pandas/numpy not installed
Nov 2, 2023
731c757
Remove obsolete code
Nov 2, 2023
d94d9d3
Fix bug in inspection script and improve test
Nov 2, 2023
e3f4ae3
Fix tests pre 5.7
Nov 2, 2023
7359fa0
Remove uniqueness constraint in expected file pre 5.7
Nov 2, 2023
f6f36c9
Remove non-reachable line
Nov 2, 2023
33cd9bc
Add upcoming breaking changes notice
Nov 2, 2023
3a816c9
Convert README to Markdown
Nov 2, 2023
bf4025c
Improve README layout
Nov 2, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Add tests for install/remove labels scripts
Marius Conjeaud committed Oct 13, 2023
commit d7fda767f6c35e03cf7d775d51d4c60ba508b827
84 changes: 84 additions & 0 deletions test/test_scripts.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
import subprocess

from neomodel import (
RelationshipTo,
StringProperty,
StructuredNode,
StructuredRel,
config,
db,
)


class ScriptsTestRel(StructuredRel):
some_unique_property = StringProperty(unique_index=True)
some_index_property = StringProperty(index=True)


class ScriptsTestNode(StructuredNode):
personal_id = StringProperty(unique_index=True)
name = StringProperty(index=True)
rel = RelationshipTo("ScriptsTestNode", "REL", model=ScriptsTestRel)


def test_neomodel_install_labels():
result = subprocess.run(
["neomodel_install_labels", "--help"],
capture_output=True,
text=True,
check=False,
)
assert "usage: neomodel_install_labels" in result.stdout
assert result.returncode == 0

result = subprocess.run(
["neomodel_install_labels", "test/test_scripts.py", "--db", db.url],
capture_output=True,
text=True,
check=False,
)
assert result.returncode == 0
assert "Setting up indexes and constraints" in result.stdout
constraints = db.list_constraints()
parsed_constraints = [
(element["type"], element["labelsOrTypes"], element["properties"])
for element in constraints
]
assert ("UNIQUENESS", ["ScriptsTestNode"], ["personal_id"]) in parsed_constraints
assert (
"RELATIONSHIP_UNIQUENESS",
["REL"],
["some_unique_property"],
) in parsed_constraints
indexes = db.list_indexes()
parsed_indexes = [
(element["labelsOrTypes"], element["properties"]) for element in indexes
]
assert (["ScriptsTestNode"], ["name"]) in parsed_indexes
assert (["REL"], ["some_index_property"]) in parsed_indexes


def test_neomodel_remove_labels():
result = subprocess.run(
["neomodel_remove_labels", "--help"],
capture_output=True,
text=True,
check=False,
)
assert "usage: neomodel_remove_labels" in result.stdout
assert result.returncode == 0

result = subprocess.run(
["neomodel_remove_labels", "--db", config.DATABASE_URL],
capture_output=True,
text=True,
check=False,
)
assert (
"Dropping unique constraint and index on label ScriptsTestNode" in result.stdout
)
assert result.returncode == 0
constraints = db.list_constraints()
indexes = db.list_indexes(exclude_token_lookup=True)
assert len(constraints) == 0
assert len(indexes) == 0