"""Integration tests suite for abacus-common-data.""" import abacus_common_data def test_imports(): """Test module imports.""" from abacus_common_data.currency import get_currency_object_from_code from abacus_common_data import currency assert currency.get_currency_object_from_code == \ get_currency_object_from_code from abacus_common_data.country import Country from abacus_common_data import country assert country.Country == Country def test_country(): """Test country module.""" usa = abacus_common_data.country.Country('USA') assert usa.to_dict() == { 'alpha2': 'US', 'alpha3': 'USA', 'numeric': '840', 'name': 'United States of America', 'region': 'Americas' } def test_currency(): """Test currency module.""" us_dollar = abacus_common_data.currency.get_currency_object_from_code('USD') assert us_dollar == { 'currency_id': 840, 'currency_code': 'USD', 'currency_name': 'US Dollar' } def test_transaction_type(): """Test transaction type module.""" transaction_type = abacus_common_data.transaction_type.TransactionType('DT') assert transaction_type.txn_type_code == 'DT' assert transaction_type.txn_type_id == 19 assert transaction_type.txn_type_desc == 'Download Tracks' def test_all_transaction_types(): """Test getting all transaction types.""" transaction_types = abacus_common_data.transaction_type.TransactionType.list_all_txn_types() # noqa: E501 assert isinstance(transaction_types, list) assert len(transaction_types) > 1 def test_store(): """Test store module.""" store = abacus_common_data.store.Store(1) assert store.store_id == 1 assert store.store_name == 'iTunes/Apple' def test_all_stores(): """Test getting all stores.""" stores = abacus_common_data.store.Store.list_all_stores() assert isinstance(stores, list) assert len(stores) > 1