def is_valid(dataElementUri): dfe = GirderDataElement.from_uri(dataElementUri) if is_valid_element(dfe, valid_content_types=valid_content_types, check_image=True): return dfe else: return False
def is_valid(dataElementUri): dfe = GirderDataElement.from_uri(dataElementUri) if is_valid_element(dfe, valid_content_types=valid_content_types, check_image=True): return dfe else: return False
def test_from_uri_full_url(self): e = GirderDataElement.from_uri(self.EXAMPLE_GIRDER_FULL_URI) self.assertEqual(e.file_id, self.EXAMPLE_ITEM_ID)
def test_from_uri_full_url(self): e = GirderDataElement.from_uri(self.EXAMPLE_GIRDER_FULL_URI) self.assertEqual(e.file_id, self.EXAMPLE_ITEM_ID)
def test_from_uri_simple_uri(self): e = GirderDataElement.from_uri(self.EXAMPLE_GIRDER_SIMPLE_URI) nose.tools.assert_equal(e.api_root, self.LOCAL_APIROOT) nose.tools.assert_equal(e.file_id, self.EXAMPLE_ITEM_ID) nose.tools.assert_equal(e.token_manager.api_key, None)
def test_from_uri_full_url(self): e = GirderDataElement.from_uri(self.EXAMPLE_GIRDER_FULL_URI) nose.tools.assert_equal(e.api_root, self.EXAMPLE_GIRDER_API_ROOT) nose.tools.assert_equal(e.file_id, self.EXAMPLE_ITEM_ID) nose.tools.assert_equal(e.token_manager.api_key, None)