def test_quant_gen_gen(self): fg = FuzzyGenerator("$range(2)$ dnd$'as'$", "pp") self.assertEqual(fg.calculate_quantity(), 4) self.assertEqual(list(fg.generate()), [ ('0 dnda', 'pp'), ('0 dnds', 'pp'), ('1 dnda', 'pp'), ('1 dnds', 'pp')])
def test_quantities(self): fg = FuzzyGenerator("$range(2)$ dnd$'as'$", "pp") self.assertEqual(fg.calculate_quantity(), 4) fg = FuzzyGenerator("$range(2)$ n$'as'$", "p$string.lowercase[:2]$") self.assertEqual(fg.calculate_quantity(), 8)