-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #76 from NERSC/api-base-url
Allow api url and token url to be configured
- Loading branch information
Showing
18 changed files
with
253 additions
and
226 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,15 @@ | ||
import pytest | ||
from sfapi_client import Client | ||
|
||
|
||
@pytest.mark.public | ||
def test_changelog(): | ||
with Client() as client: | ||
def test_changelog(unauthenticated_client): | ||
with unauthenticated_client as client: | ||
changelog = client.api.changelog() | ||
assert len(changelog) > 0 | ||
|
||
|
||
@pytest.mark.public | ||
def test_config(): | ||
with Client() as client: | ||
def test_config(unauthenticated_client): | ||
with unauthenticated_client as client: | ||
config = client.api.config() | ||
assert "compute.targets" in config |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,17 @@ | ||
import pytest | ||
|
||
from sfapi_client import AsyncClient | ||
|
||
|
||
@pytest.mark.public | ||
@pytest.mark.asyncio | ||
async def test_changelog(): | ||
async with AsyncClient() as client: | ||
async def test_changelog(async_unauthenticated_client): | ||
async with async_unauthenticated_client as client: | ||
changelog = await client.api.changelog() | ||
assert len(changelog) > 0 | ||
|
||
|
||
@pytest.mark.public | ||
@pytest.mark.asyncio | ||
async def test_config(): | ||
async with AsyncClient() as client: | ||
async def test_config(async_unauthenticated_client): | ||
async with async_unauthenticated_client as client: | ||
config = await client.api.config() | ||
assert "compute.targets" in config |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,17 @@ | ||
import pytest | ||
|
||
from sfapi_client import Client, SfApiError | ||
from sfapi_client import SfApiError | ||
|
||
|
||
@pytest.mark.public | ||
def test_no_creds(): | ||
with Client() as client: | ||
def test_no_creds(unauthenticated_client): | ||
with unauthenticated_client as client: | ||
assert client is not None | ||
|
||
|
||
@pytest.mark.public | ||
def test_no_creds_auth_required(test_machine): | ||
with Client() as client: | ||
def test_no_creds_auth_required(unauthenticated_client, test_machine): | ||
with unauthenticated_client as client: | ||
machine = client.compute(test_machine) | ||
with pytest.raises(SfApiError): | ||
machine.jobs() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,19 @@ | ||
import pytest | ||
|
||
from sfapi_client import AsyncClient, SfApiError | ||
from sfapi_client import SfApiError | ||
|
||
|
||
@pytest.mark.public | ||
@pytest.mark.asyncio | ||
async def test_no_creds(): | ||
async with AsyncClient() as client: | ||
async def test_no_creds(async_unauthenticated_client): | ||
async with async_unauthenticated_client as client: | ||
assert client is not None | ||
|
||
|
||
@pytest.mark.public | ||
@pytest.mark.asyncio | ||
async def test_no_creds_auth_required(test_machine): | ||
async with AsyncClient() as client: | ||
async def test_no_creds_auth_required(async_unauthenticated_client, test_machine): | ||
async with async_unauthenticated_client as client: | ||
machine = await client.compute(test_machine) | ||
with pytest.raises(SfApiError): | ||
await machine.jobs() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.