def test_cartesian_product_multiple(self):
     parameters_content_list = [[{
         "a": 1
     }, {
         "a": 2
     }], [{
         "x": 111,
         "y": 112
     }, {
         "x": 121,
         "y": 122
     }]]
     product_list = testcase.gen_cartesian_product(*parameters_content_list)
     self.assertEqual(product_list, [{
         'a': 1,
         'x': 111,
         'y': 112
     }, {
         'a': 1,
         'x': 121,
         'y': 122
     }, {
         'a': 2,
         'x': 111,
         'y': 112
     }, {
         'a': 2,
         'x': 121,
         'y': 122
     }])
Example #2
0
 def test_cartesian_product_one(self):
     parameters_content_list = [
         [
             {"a": 1},
             {"a": 2}
         ]
     ]
     product_list = testcase.gen_cartesian_product(*parameters_content_list)
     self.assertEqual(
         product_list,
         [
             {"a": 1},
             {"a": 2}
         ]
     )
Example #3
0
 def test_cartesian_product_one(self):
     parameters_content_list = [
         [
             {"a": 1},
             {"a": 2}
         ]
     ]
     product_list = testcase.gen_cartesian_product(*parameters_content_list)
     self.assertEqual(
         product_list,
         [
             {"a": 1},
             {"a": 2}
         ]
     )
Example #4
0
 def test_cartesian_product_multiple(self):
     parameters_content_list = [
         [
             {"a": 1},
             {"a": 2}
         ],
         [
             {"x": 111, "y": 112},
             {"x": 121, "y": 122}
         ]
     ]
     product_list = testcase.gen_cartesian_product(*parameters_content_list)
     self.assertEqual(
         product_list,
         [
             {'a': 1, 'x': 111, 'y': 112},
             {'a': 1, 'x': 121, 'y': 122},
             {'a': 2, 'x': 111, 'y': 112},
             {'a': 2, 'x': 121, 'y': 122}
         ]
     )
Example #5
0
 def test_cartesian_product_empty(self):
     parameters_content_list = []
     product_list = testcase.gen_cartesian_product(*parameters_content_list)
     self.assertEqual(product_list, [])
Example #6
0
 def test_cartesian_product_empty(self):
     parameters_content_list = []
     product_list = testcase.gen_cartesian_product(*parameters_content_list)
     self.assertEqual(product_list, [])