예제 #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)