Esempio n. 1
0
    def test_lookup_table_12(self):
        n_tokens = 12
        builder = CatalanPyramid()
        table = builder.lookup_table(n_tokens)

        for r1, r2 in zip(table, target_12):
            for c1, c2 in zip(r1, r2):
                assert almost_equal(c1, c2), "\nRet: {}\nExp: {}".format(r1, r2)
Esempio n. 2
0
    def test_lookup_table_3(self):
        n_tokens = 3
        builder = CatalanPyramid()
        table = builder.lookup_table(n_tokens)

        for r1, r2 in zip(table, target_3):
            for c1, c2 in zip(r1, r2):
                assert c1 == c2, "\nRet: {}\nExp: {}".format(r1, r2)