Commit 1a66c641 authored by Samuel GAIST's avatar Samuel GAIST

[database] Add property to check if raw data access is enabled

parent 164bf684
......@@ -247,3 +247,12 @@ class Database(BackendDatabase):
if self.schema_version != 1:
for view in protocol["views"].keys():
self._validate_view(view)
@property
def is_database_rawdata_access_enabled(self):
"""Returns whether raw data sharing was enabled
This property is only useful for the Docker executor.
"""
return self.data.get("direct_rawdata_access", False)
......@@ -61,3 +61,22 @@ def export(db_name):
# load from tmp_prefix and validates
exported = Database(tmp_prefix, db_name)
nose.tools.assert_true(exported.valid, "\n * %s" % "\n * ".join(exported.errors))
def test_rawdata_access():
for i in range(1, 3):
yield rawdata_access, f"integers_db/{i}", False
yield rawdata_access, f"simple/{i}", False
yield rawdata_access, f"large/{i}", False
yield rawdata_access, f"simple_rawdata_access/{i}", True
@nose.tools.with_setup(teardown=cleanup)
def rawdata_access(db_name, rawdata_access_enabled):
obj = Database(prefix, db_name)
nose.tools.assert_true(obj.valid, "\n * %s" % "\n * ".join(obj.errors))
nose.tools.assert_equal(
obj.is_database_rawdata_access_enabled, rawdata_access_enabled
)
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment