This authentication methods needs to return an error message if the username or pass do not match with HydroShare.
Right now, either way, "hs" returns a value. Not sure whats the best way to programatcily catch an expectation when the credentials are not correct.
To authenticate using HTTP Basic authentication, and then get a list of resources you have access to:
from hs_restclient import HydroShare, HydroShareAuthBasic
auth = HydroShareAuthBasic(username='myusername', password='mypassword')
hs = HydroShare(auth=auth)
for resource in hs.getResourceList():
print(resource)
This authentication methods needs to return an error message if the username or pass do not match with HydroShare.
Right now, either way, "hs" returns a value. Not sure whats the best way to programatcily catch an expectation when the credentials are not correct.