55
66class TestDataset :
77 def test_create_rpa_dataset (self , fake_api ):
8- dataset = Dataset (api = fake_api , name = "test" )
8+ dataset = Dataset (product = "rpa" , api = fake_api , name = "test" )
99 assert dataset .name == "test"
1010 assert dataset .api == fake_api
11- assert dataset .product == "RPA "
11+ assert dataset .product == "rpa "
1212 dataset .save ()
1313 assert fake_api .datasets ["1" ] == {
1414 "uuid" : "1" ,
15- "product" : "RPA " ,
15+ "product" : "rpa " ,
1616 "product_version" : "1.0" ,
1717 "name" : "test" ,
1818 }
@@ -30,13 +30,18 @@ def test_create_edge_dataset(self, fake_api):
3030 "name" : "test" ,
3131 }
3232
33- def test_create_dataset_with_default_product (self , fake_api ):
33+ @pytest .mark .parametrize (
34+ "product" ,
35+ ["rpa" , "edge" ],
36+ )
37+ def test_create_dataset_with_default_product (self , product ):
38+ fake_api = FakeAPI (product = product )
3439 dataset = Dataset (api = fake_api , name = "test" )
35- assert dataset .product == "RPA"
40+ assert dataset .product == product
3641 dataset .save ()
3742 assert fake_api .datasets ["1" ] == {
3843 "uuid" : "1" ,
39- "product" : "RPA" ,
44+ "product" : product ,
4045 "product_version" : "1.0" ,
4146 "name" : "test" ,
4247 }
@@ -117,8 +122,9 @@ def fake_api(self):
117122
118123
119124class FakeAPI :
120- def __init__ (self ):
125+ def __init__ (self , product = "rpa" ):
121126 self .datasets = {}
127+ self .product = product
122128
123129 def request (self , endpoint , method = "get" , json = None ):
124130 if method == "post" :
0 commit comments