def test_possible_daughters(self): ts = list(regular_combinations((6, 3))) self.assertEqual(19, len(ts)) self.assertTrue(all(6 == sum(m for m,a in t) for t in ts)) self.assertTrue(all(3 == sum(a for m,a in t) for t in ts))
def test_triples(self): it = regular_combinations((2, 1)) self.assertEqual([ ((2, 1),), ((1, 0), (1, 1)), ], list(it))