From 0ccff670b1a11f93be22ef87f81f4ee311c08cc9 Mon Sep 17 00:00:00 2001 From: Austin Raney Date: Fri, 19 Nov 2021 12:50:26 -0500 Subject: [PATCH] update configuration unit tests --- tests/test_config.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/tests/test_config.py b/tests/test_config.py index 7a4afd3f..ec959f4b 100644 --- a/tests/test_config.py +++ b/tests/test_config.py @@ -1,6 +1,6 @@ import pytest import pickle -from hydroshare_jupyter_sync.config_setup import ConfigFile, FileNotDirectoryError +from hydroshare_on_jupyter.config_setup import ConfigFile, FileNotDirectoryError from tempfile import TemporaryDirectory, TemporaryFile from pathlib import Path @@ -34,6 +34,7 @@ def test_config_using_env_vars(monkeypatch): def test_config_using_env_file(): """Test configuration using environment variables""" with TemporaryDirectory() as temp: + temp = Path(temp).resolve() log = Path(temp) / "logs" env_contents = f""" DATA={temp} @@ -67,12 +68,12 @@ def oauth_file(oauth_data) -> Path: filename = ".hs_auth" with TemporaryDirectory() as dir: - oauth_path = Path(dir) / filename + oauth_path = (Path(dir) / filename).resolve() with open(oauth_path, "wb") as f: pickle.dump(oauth_data, f, protocol=2) yield oauth_path def test_config_oauth(oauth_file, oauth_data): - o = ConfigFile(oauth_path=oauth_file) - assert o.oauth_path.access_token == oauth_data[0]["access_token"] + o = ConfigFile(oauth_path=str(oauth_file)) + assert o.oauth_path.__root__[0].access_token == oauth_data[0]["access_token"]