def test_sample5(self): f = open('inf/parsing/samples/sample5_solution.py') data = f.read() f.close() setup_test(self, 'samples/sample5.py') utils.traverse_ast(self.node) self.assertEqual(data, utils.node_to_str(self.node))
def test_sample1(self): setup_test(self, 'samples/sample1.py') lc = self.lc exec(self.code, self.gl, self.lc) pokus = lc['Pokus']() a = lc['a'] b = lc['b'] mul = lc['mul'] self.assertEqual(pokus.get_all(), (10, 10, 10)) self.assertEqual(a, 'jozo') self.assertEqual(b, 23) self.assertEqual(mul(4)(5), 20) self.assertTrue(re.search('riadkov', pokus.__init__.__doc__)) utils.traverse_ast(self.node) self.assertEqual(self.code, utils.node_to_str(self.node))
def test_sample1(self): setup_test(self, 'samples/sample1.py') lc=self.lc exec(self.code,self.gl,self.lc) pokus=lc['Pokus']() a=lc['a'] b=lc['b'] mul=lc['mul'] self.assertEqual(pokus.get_all(), (10,10,10)) self.assertEqual(a, 'jozo') self.assertEqual(b, 23) self.assertEqual(mul(4)(5), 20) self.assertTrue(re.search('riadkov', pokus.__init__.__doc__)) utils.traverse_ast(self.node) self.assertEqual(self.code, utils.node_to_str(self.node))