diff --git a/tests/conftest.py b/tests/conftest.py index 197f188..4be3ac1 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -1,5 +1,4 @@ import pytest - from netsuite import Config @@ -16,6 +15,11 @@ def dummy_config(): ) +@pytest.fixture +def dummy_config_with_production_account(dummy_config): + return Config(account="123456", auth=dummy_config.auth) + + @pytest.fixture def dummy_username_password_config(): return Config( diff --git a/tests/test_odbc.py b/tests/test_odbc.py index 241645b..a6879bd 100644 --- a/tests/test_odbc.py +++ b/tests/test_odbc.py @@ -1,4 +1,25 @@ # TODO need more expanded tests here -def test_expected_hostname(dummy_username_password_config): + + +def test_tba(dummy_config): + assert dummy_config.is_token_auth + + +def test_sandbox_account(dummy_config): + assert dummy_config.is_sandbox + assert dummy_config.account_number == "123456" + assert dummy_config.account_slugified == "123456-sb1" + + +def test_production_account_extraction(dummy_config_with_production_account): + assert "_SB" not in dummy_config_with_production_account.account + assert dummy_config_with_production_account.account_number == "123456" + assert dummy_config_with_production_account.is_sandbox is False + assert dummy_config_with_production_account.account_slugified == "123456" + + +def test_username_auth(dummy_username_password_config): config = dummy_username_password_config + assert config.auth.username == "username" + assert not config.is_token_auth