Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def test_client_can_be_created(unauth_client):
"""Test that the client object can be created."""
assert isinstance(unauth_client, AvataxClient)
def test_client_can_obtain_their_own_base_url():
"""Test the client can input a url as the base url."""
client = AvataxClient('test app', 'ver 0.0', 'test machine', 'https://myurl.com')
assert client.base_url == 'https://myurl.com'
def test_client_can_obtain_production_url_as_base_url():
"""Test the default option for base url is production url."""
client = AvataxClient('test app', 'ver 0.0', 'test machine')
assert client.base_url == 'https://rest.avatax.com'
def test_auth_able_to_call_and_return_self(unauth_client):
"""Test client can call add_cred method and returns an avatax client obj."""
assert isinstance(unauth_client.add_credentials(), AvataxClient)
def test_initialize_builder_object(auth_client):
"""Test if a new transaction can be initialize."""
new_trans = TransactionBuilder(auth_client, 'DEFAULT', 'SalesInvoice', 'ABC123')
assert isinstance(new_trans, TransactionBuilder)
def test_initialize_builder_object(auth_client):
"""Test if a new transaction can be initialize."""
new_trans = TransactionBuilder(auth_client, 'DEFAULT', 'SalesInvoice', 'ABC123')
assert isinstance(new_trans, TransactionBuilder)