Skip to content

Commit

Permalink
Add tests for endpoint dict
Browse files Browse the repository at this point in the history
  • Loading branch information
gordonwatts committed Dec 28, 2024
1 parent d329059 commit 5ffd6ec
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
1 change: 1 addition & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@
"ncols",
"ndarray",
"NOQA",
"notreallyatoken",
"nqueries",
"ntuples",
"numpy",
Expand Down
15 changes: 15 additions & 0 deletions tests/test_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,21 @@ def test_config_read(tempdir):
Configuration.read(config_path="invalid.yaml")


@patch('servicex.configuration.tempfile.gettempdir', return_value="./mytemp")
def test_config_endpoint_dict(tempdir):
os.environ['UserName'] = "p_higgs"
c = Configuration.read(config_path="tests/example_config.yaml")
endpoints = c.endpoint_dict()
assert len(endpoints) == 3
assert "servicex-uc-af" in endpoints

# Make sure we get back what we expect
ep = endpoints["servicex-uc-af"]
assert ep.endpoint == "https://servicex.af.uchicago.edu"
assert ep.name == "servicex-uc-af"
assert ep.token == "notreallyatoken"


@patch('servicex.configuration.tempfile.gettempdir', return_value="./mytemp")
def test_default_cache_path(tempdir):

Expand Down

0 comments on commit 5ffd6ec

Please sign in to comment.