Skip to content
Snippets Groups Projects
Commit 097a2a5c authored by Alexander Schlemmer's avatar Alexander Schlemmer
Browse files

ENH: made getters and setters specific to files inacessible for other roles

parent d38d3612
No related branches found
No related tags found
2 merge requests!57RELEASE 0.7.3,!52F refactor high level api
Pipeline #19930 failed
...@@ -270,7 +270,15 @@ def test_empty(): ...@@ -270,7 +270,15 @@ def test_empty():
rconv = convert_to_entity(obj) rconv = convert_to_entity(obj)
assert len(rconv.properties) == 0 assert len(rconv.properties) == 0
def test_wrong_entity_for_file():
r = db.Record()
r.path = "test.dat"
r.file = "/local/path/test.dat"
assert r.path == "test.dat"
assert r.file == "/local/path/test.dat"
with pytest.raises(RuntimeError):
obj = convert_to_python_object(r)
def test_files(): def test_files():
# empty file: # empty file:
...@@ -290,3 +298,6 @@ def test_files(): ...@@ -290,3 +298,6 @@ def test_files():
assert r.path == "test.dat" assert r.path == "test.dat"
assert r.file == "/local/path/test.dat" assert r.file == "/local/path/test.dat"
assert isinstance(obj, CaosDBPythonFile) assert isinstance(obj, CaosDBPythonFile)
assert obj.path == "test.dat"
assert obj.file == "/local/path/test.dat"
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment