def resolve_doi(doi): """ Takes as input a DOI and returns the internal HydroShare identifier (pid) for a resource. This method will be used to get the HydroShare pid for a resource identified by a doi for further operations using the web service API. REST URL: GET /resolveDOI/{doi} Parameters: doi - A doi assigned to a resource in HydroShare. Returns: The pid of the resource that was published Return Type: pid Raises: Exceptions.NotAuthorized - The user is not authorized Exceptions.NotFound - The resource identified by pid does not exist Exception.ServiceFailure - The service is unable to process the request Note: All HydroShare methods (except this one) will use HydroShare internal identifiers (pids). This method exists so that a program can resolve the pid for a DOI. """ return utils.get_resource_by_doi(doi).short_id
def test_get_resource_by_doi(self): self.assertEqual( utils.get_resource_by_doi('doi1000100010001'), self.res )