示例#1
0
    def test_quant_gen_gen(self):
        fg = FuzzyGenerator("$range(2)$ dnd$'as'$", "pp")
        self.assertEqual(fg.calculateQuantity(), 4)

        self.assertEqual(list(fg.generate()), [
            ('0 dnda', 'pp'), ('0 dnds', 'pp'),
            ('1 dnda', 'pp'), ('1 dnds', 'pp')])
示例#2
0
    def test_quantities(self):
        fg = FuzzyGenerator("$range(2)$ dnd$'as'$", "pp")
        self.assertEqual(fg.calculateQuantity(), 4)

        fg = FuzzyGenerator("$range(2)$ n$'as'$", "p$string.lowercase[:2]$")
        self.assertEqual(fg.calculateQuantity(), 8)