def testVariableProduct(self): u1 = self.prog.NewVariable([1, 2], [], self.current_location) u2 = self.prog.NewVariable([3, 4], [], self.current_location) product = utils.variable_product([u1, u2]) pairs = [[a.data for a in d] for d in product] self.assertItemsEqual(pairs, [ [1, 3], [1, 4], [2, 3], [2, 4], ])
def testVariableProduct(self): u1 = self.prog.NewVariable("u1", [1, 2], [], self.current_location) u2 = self.prog.NewVariable("u2", [3, 4], [], self.current_location) product = utils.variable_product([u1, u2]) pairs = [[a.data for a in d] for d in product] self.assertItemsEqual(pairs, [ [1, 3], [1, 4], [2, 3], [2, 4], ])