99 AsyncBilling ,
1010 AsyncCatalog ,
1111 AsyncCommerce ,
12+ AsyncNotifications ,
1213 Audit ,
1314 Billing ,
1415 Catalog ,
1516 Commerce ,
17+ Notifications ,
1618)
1719from tests .conftest import API_TOKEN , API_URL
1820
@@ -21,23 +23,22 @@ def get_mpt_client():
2123 return MPTClient .from_config (base_url = API_URL , api_token = API_TOKEN )
2224
2325
24- def get_async_mpt_client ():
25- return AsyncMPTClient .from_config (base_url = API_URL , api_token = API_TOKEN )
26-
27-
2826@pytest .mark .parametrize (
29- ("domain_module " , "domain_type " ),
27+ ("resource_name " , "expected_type " ),
3028 [
31- (get_mpt_client (), MPTClient ),
32- (get_mpt_client (). commerce , Commerce ),
33- (get_mpt_client (). catalog , Catalog ),
34- (get_mpt_client (). audit , Audit ),
35- (get_mpt_client (). billing , Billing ),
36- (get_mpt_client (). accounts , Accounts ),
29+ ("commerce" , Commerce ),
30+ ("catalog" , Catalog ),
31+ ("audit" , Audit ),
32+ ("billing" , Billing ),
33+ ("accounts" , Accounts ),
34+ ("notifications" , Notifications ),
3735 ],
3836)
39- def test_mpt_client (domain_module , domain_type ) -> None :
40- assert isinstance (domain_module , domain_type )
37+ def test_mpt_client (resource_name : str , expected_type : type ) -> None :
38+ mpt = MPTClient .from_config (base_url = API_URL , api_token = API_TOKEN )
39+ resource = getattr (mpt , resource_name )
40+ assert isinstance (mpt , MPTClient )
41+ assert isinstance (resource , expected_type )
4142
4243
4344def test_mpt_client_env (monkeypatch : pytest .MonkeyPatch ) -> None :
@@ -51,18 +52,22 @@ def test_mpt_client_env(monkeypatch: pytest.MonkeyPatch) -> None:
5152
5253
5354@pytest .mark .parametrize (
54- ("domain_module " , "domain_type " ),
55+ ("resource_name " , "expected_type " ),
5556 [
56- (get_async_mpt_client (), AsyncMPTClient ),
57- (get_async_mpt_client (). commerce , AsyncCommerce ),
58- (get_async_mpt_client (). catalog , AsyncCatalog ),
59- (get_async_mpt_client (). audit , AsyncAudit ),
60- (get_async_mpt_client (). billing , AsyncBilling ),
61- (get_async_mpt_client (). accounts , AsyncAccounts ),
57+ ("commerce" , AsyncCommerce ),
58+ ("catalog" , AsyncCatalog ),
59+ ("audit" , AsyncAudit ),
60+ ("billing" , AsyncBilling ),
61+ ("accounts" , AsyncAccounts ),
62+ ("notifications" , AsyncNotifications ),
6263 ],
6364)
64- def test_async_mpt_client (domain_module , domain_type ) -> None :
65- assert isinstance (domain_module , domain_type )
65+ def test_async_mpt_client (resource_name : str , expected_type : type ) -> None :
66+ mpt = AsyncMPTClient .from_config (base_url = API_URL , api_token = API_TOKEN )
67+ resource = getattr (mpt , resource_name )
68+
69+ assert isinstance (mpt , AsyncMPTClient )
70+ assert isinstance (resource , expected_type )
6671
6772
6873def test_async_mpt_client_env (monkeypatch : pytest .MonkeyPatch ) -> None :
0 commit comments