Skip to content

Commit

Permalink
test: expanding account helper tests
Browse files Browse the repository at this point in the history
  • Loading branch information
iloveitaly committed Feb 28, 2024
1 parent a66bf39 commit 3e342d8
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 2 deletions.
6 changes: 5 additions & 1 deletion tests/conftest.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import pytest

from netsuite import Config


Expand All @@ -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(
Expand Down
23 changes: 22 additions & 1 deletion tests/test_odbc.py
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit 3e342d8

Please sign in to comment.