"""Tests for account utilities.""" import pytest from collaborator.utils import typing @pytest.mark.parametrize( "account, expected_text", [ (typing.Account("vendor", "1234"), "1234L"), (typing.Account("subaccount", "4321"), "4321S"), (typing.Account("unknown", "0"), "0L"), ], ) def test_account_str(account, expected_text): """Test converting an Account to text.""" assert str(account) == expected_text @pytest.mark.parametrize( "sort, expected_text", [ (typing.Sort("name", "DESC"), "name DESC"), (typing.Sort("name", "ASC"), "name ASC"), (typing.Sort("test", "whatever"), "test whatever"), ], ) def test_sort_str(sort, expected_text): """Test converting a Sort object to text.""" assert str(sort) == expected_text @pytest.mark.parametrize( "user, expected_text", [ (typing.User("oa", "1234"), "oa:1234"), (typing.User("alw", "4321"), "alw:4321"), (typing.User("test", "0"), "test:0"), ], ) def test_user_str(user, expected_text): """Test converting a User to text.""" assert str(user) == expected_text