diff --git a/src/dataregistry/DataRegistry.py b/src/dataregistry/DataRegistry.py index 1ab0b5eb..00814f25 100644 --- a/src/dataregistry/DataRegistry.py +++ b/src/dataregistry/DataRegistry.py @@ -59,18 +59,18 @@ def __init__( self.db_connection = DbConnection(config_file, schema=schema, verbose=verbose) # Work out the location of the root directory - root_dir = self._get_root_dir(root_dir, site) + self.root_dir = self._get_root_dir(root_dir, site) # Create registrar object self.Registrar = Registrar( self.db_connection, - root_dir, + self.root_dir, owner=owner, owner_type=owner_type, ) # Create query object - self.Query = Query(self.db_connection, root_dir) + self.Query = Query(self.db_connection, self.root_dir) def _get_root_dir(self, root_dir, site): """ diff --git a/tests/unit_tests/test_root_dir.py b/tests/unit_tests/test_root_dir.py index 44d1841f..fe0e56ec 100644 --- a/tests/unit_tests/test_root_dir.py +++ b/tests/unit_tests/test_root_dir.py @@ -39,5 +39,4 @@ def test_root_dir_manual(root_dir, site, set_env_var, ans): if reg.db_connection.dialect != "sqlite": assert reg.db_connection.schema is not None - assert reg.Registrar._root_dir == ans - assert reg.Query._root_dir == ans + assert reg.root_dir == ans