diff --git a/unittests/test_high_level_api.py b/unittests/test_high_level_api.py index ae169b3c0653efcc6d1de823eef49ec25044bb32..c94fd8aa66946fdc3bedaec67a1bd0608f23cc74 100644 --- a/unittests/test_high_level_api.py +++ b/unittests/test_high_level_api.py @@ -270,7 +270,15 @@ def test_empty(): rconv = convert_to_entity(obj) 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(): # empty file: @@ -290,3 +298,6 @@ def test_files(): assert r.path == "test.dat" assert r.file == "/local/path/test.dat" assert isinstance(obj, CaosDBPythonFile) + + assert obj.path == "test.dat" + assert obj.file == "/local/path/test.dat"