Esempio n. 1
0
    def test__compile(self):
        a = 3
        b = 4
        x = [a, b]
        d = {a: b}

        # just test that nothing in TEST_LIST throws an exception when compiled
        for itm in TEST_LIST:
            try:
                eval(ep.compile(ep.parse(itm)))
            except Exception as err:
                bad_itm = str(err)
                bad_itm += " for expr:"
                bad_itm += itm
                raise RuntimeError(bad_itm)
    def test__compile(self):
        a = 3
        b = 4
        x = [a, b]
        d = {a: b}

        # just test that nothing in TEST_LIST throws an exception when compiled
        for itm in TEST_LIST:
            try:
                eval(ep.compile(ep.parse(itm)))
            except Exception as err:
                bad_itm = str(err)
                bad_itm += " for expr:"
                bad_itm += itm
                raise RuntimeError(bad_itm)
Esempio n. 3
0
 def test_unparse_ret(self):
     for itm in TEST_LIST:
         self.assertTrue(isinstance(ep.unparse(ep.parse(itm)), str))
Esempio n. 4
0
 def test_parse_symmetric(self):
     for itm in TEST_LIST:
         self.assertEqual(repr(ep.parse(ep.unparse(ep.parse(itm)))),
                          repr(ep.parse(itm)))
 def test_unparse_ret(self):
     for itm in TEST_LIST:
         self.assertTrue(isinstance(ep.unparse(ep.parse(itm)), str))
 def test_parse_symmetric(self):
     for itm in TEST_LIST:
         self.assertEqual(repr(ep.parse(ep.unparse(ep.parse(itm)))),
                          repr(ep.parse(itm)))