diff --git a/src/python/pybis/pybis.py b/src/python/pybis/pybis.py index 8b0d081e3d99f9413f4280cdc70741c08a83b4bc..c968523d0730baf029a6ae19531aaabb4df144a5 100644 --- a/src/python/pybis/pybis.py +++ b/src/python/pybis/pybis.py @@ -59,7 +59,9 @@ class OpenbisCredentialStore: """ if not os.path.exists(self.store_path): return OpenbisCredentials() - # TODO Implement reading a credentials file + with open(self.store_path, "r") as f: + token = f.read() + return OpenbisCredentials(token) def write(self, credentials): """Write a credentials object to the store, overwriting any previous information. diff --git a/src/python/pybis/pybis_test.py b/src/python/pybis/pybis_test.py index 5c9dcf3c65261f2937584f0cdcddec5615554e3e..8f22386a65825f17b5b0502427ee3ea8d7d17bf8 100644 --- a/src/python/pybis/pybis_test.py +++ b/src/python/pybis/pybis_test.py @@ -18,4 +18,5 @@ def test_credentials_store(tmpdir): store = OpenbisCredentialStore(str(tmpdir)) store.write(credentials) disk_credentials = store.read() - assert credentials.token == disk_credentials.token \ No newline at end of file + assert credentials.token == disk_credentials.token + assert not disk_credentials.has_username_and_password()