def test_closest_value(self): with rac_vcr.use_cassette("test_closest_value.json"): repository = ASpace( baseurl="http://localhost:8089").repositories(2) archival_object = repository.archival_objects(7) value = data_helpers.closest_value(archival_object, "extents") self.assertTrue(len(value) > 0)
def test_object_locations(self): """Checks whether the function returns a list of JSONModelObjects.""" with rac_vcr.use_cassette("test_get_locations.json"): repository = ASpace( baseurl="http://localhost:8089").repositories(2) archival_object = repository.archival_objects(7) locations = data_helpers.object_locations(archival_object) self.assertIsInstance(locations, list) self.assertEqual(len(locations), 1) for obj in locations: self.assertIsInstance(obj, JSONModelObject)