- def test_locator_init_fallback_to_keep(self):
- # crunch-job needs this to read manifests that have only ever
- # been written to Keep.
- client = self.api_client_mock(200)
- self.mock_get_collection(client, 404, None)
- with tutil.mock_keep_responses(self.DEFAULT_MANIFEST, 200):
- reader = arvados.CollectionReader(self.DEFAULT_DATA_HASH,
- api_client=client)
- self.assertEqual(self.DEFAULT_MANIFEST, reader.manifest_text())
-
- def test_uuid_init_no_fallback_to_keep(self):
- # Do not look up a collection UUID in Keep.
- client = self.api_client_mock(404)
- with tutil.mock_keep_responses(self.DEFAULT_MANIFEST, 200):
- with self.assertRaises(arvados.errors.ApiError):
- reader = arvados.CollectionReader(self.DEFAULT_UUID,
- api_client=client)
-
- def test_try_keep_first_if_permission_hint(self):
- # To verify that CollectionReader tries Keep first here, we
- # mock API server to return the wrong data.
- client = self.api_client_mock(200)
- with tutil.mock_keep_responses(self.ALT_MANIFEST, 200):
- self.assertEqual(
- self.ALT_MANIFEST,
- arvados.CollectionReader(
- self.ALT_DATA_HASH + '+Affffffffffffffffffffffffffffffffffffffff@fedcba98',
- api_client=client).manifest_text())
+ def test_init_no_fallback_to_keep(self):
+ # Do not look up a collection UUID or PDH in Keep.
+ for key in [self.DEFAULT_UUID, self.DEFAULT_DATA_HASH]:
+ client = self.api_client_mock(404)
+ with tutil.mock_keep_responses(self.DEFAULT_MANIFEST, 200):
+ with self.assertRaises(arvados.errors.ApiError):
+ reader = arvados.CollectionReader(key, api_client=client)