Scheduled service maintenance on November 22


On Friday, November 22, 2024, between 06:00 CET and 18:00 CET, GIN services will undergo planned maintenance. Extended service interruptions should be expected. We will try to keep downtimes to a minimum, but recommend that users avoid critical tasks, large data uploads, or DOI requests during this time.

We apologize for any inconvenience.

test_remote.py 1.3 KB

123456789101112131415161718192021222324252627282930313233
  1. import unittest
  2. from typing import cast
  3. from dataladmetadatamodel.common import get_top_level_metadata_objects
  4. from dataladmetadatamodel.datasettree import DatasetTree
  5. from dataladmetadatamodel.metadata import Metadata
  6. from dataladmetadatamodel.metadatapath import MetadataPath
  7. class TestRemote(unittest.TestCase):
  8. def test_basic_remote(self):
  9. tree_version_list, uuid_set = get_top_level_metadata_objects(
  10. "git",
  11. "https://github.com/datalad/test_metadata"
  12. )
  13. self.assertEqual(len(tree_version_list.version_set), 1)
  14. self.assertEqual(len(uuid_set.uuid_set), 1)
  15. for version, element_info in tree_version_list.versioned_elements:
  16. time_stamp, dataset_path, dataset_tree = element_info
  17. dataset_tree = cast(DatasetTree, dataset_tree)
  18. dataset_tree.read_in()
  19. dataset_paths = dataset_tree.dataset_paths
  20. self.assertEqual(27, len(dataset_paths))
  21. mrr = dataset_tree.get_metadata_root_record(MetadataPath("study-104"))
  22. file_tree = mrr.file_tree
  23. file_paths = list(file_tree.get_paths_recursive())
  24. self.assertEqual(7, len(file_paths))
  25. file_tree.add_metadata(MetadataPath("a/b/c"), Metadata())
  26. self.assertRaises(RuntimeError, file_tree.write_out)