Skip to content

Commit

Permalink
Addressing some more review comments. Trying to fix the codecove issue
Browse files Browse the repository at this point in the history
  • Loading branch information
JMkrish committed Apr 25, 2024
1 parent e2d3dd5 commit 57d9a52
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 7 deletions.
4 changes: 3 additions & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,9 @@ jobs:
pip install -r requirements-codecoverage.txt
pip install .
mkdir test-results
coverage run -m pytest -vvv --nbmake --nbmake-timeout=300 -n=auto --junitxml=test-results/junit.xml tests
# coverage run -m pytest -vvv --nbmake --nbmake-timeout=300 -n=auto --junitxml=test-results/junit.xml tests
coverage run -m pytest -vvv -n=auto --junitxml=test-results/junit.xml tests
- run:
name: Compile Coverage Report
command: |
Expand Down
40 changes: 34 additions & 6 deletions tests/Uri/test_uri.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
from smsdk.utils import get_url


def test_uri() -> None:
def test_create_client_using_tenant() -> None:
tenant: str = ""
cli: client.Client = client.Client(tenant)

Expand All @@ -18,13 +18,43 @@ def test_uri() -> None:
assert cli.config["protocol"] == "https"
assert cli.config["site.domain"] == "sightmachine.io"

cli = client.Client(tenant, protocol="http")

assert cli.tenant == "demo"
assert cli.config["protocol"] == "http"
assert cli.config["site.domain"] == "sightmachine.io"

cli = client.Client(tenant, site_domain="localnet")

assert cli.tenant == "demo"
assert cli.config["protocol"] == "https"
assert cli.config["site.domain"] == "localnet"


def test_create_client_using_uri() -> None:
tenant = "demo-sdk-test.localnet"
cli = client.Client(tenant)

assert cli.tenant == "demo-sdk-test"
assert cli.config["protocol"] == "https"
assert cli.config["site.domain"] == "localnet"

tenant = "https://demo-sdk-test.localnet"
cli = client.Client(tenant)

assert cli.tenant == "demo-sdk-test"
assert cli.config["protocol"] == "https"
assert cli.config["site.domain"] == "localnet"

tenant = "http://demo-sdk-test.localnet:8080/"
cli = client.Client(tenant)

assert cli.tenant == "demo-sdk-test"
assert cli.config["protocol"] == "http"
assert cli.config["site.domain"] == "localnet"


def test_create_client_uri_special_cases() -> None:
tenant = "://demo-sdk-test.localnet"
cli = client.Client(tenant)

Expand All @@ -39,18 +69,16 @@ def test_uri() -> None:
assert cli.config["protocol"] == "http"
assert cli.config["site.domain"] == "sightmachine.io"

tenant = "https://demo-sdk-test.localnet"
tenant = "demo-sdk-test.localnet:8080"
cli = client.Client(tenant)

assert cli.tenant == "demo-sdk-test"
assert cli.config["protocol"] == "https"
assert cli.config["site.domain"] == "localnet"

cli = client.Client("http://demo-sdk-test.localnet:8080/")

tenant = "http://demo-sdk-test.localnet:8080/"
tenant = "://demo-sdk-test.localnet:8080"
cli = client.Client(tenant)

assert cli.tenant == "demo-sdk-test"
assert cli.config["protocol"] == "http"
assert cli.config["protocol"] == "https"
assert cli.config["site.domain"] == "localnet"

0 comments on commit 57d9a52

Please sign in to comment.