<s> import os <EOL> import sys <EOL> from bento . compat . api . moves import unittest <EOL> from bento . parser . nodes import ast_walk <EOL> from bento . parser . visitor import Dispatcher <EOL> from bento . parser . parser import parse as _parse <EOL> def parse ( data ) : <EOL> p = _parse ( data ) <EOL> dispatcher = Dispatcher ( ) <EOL> return ast_walk ( p , dispatcher ) <EOL> class TestPackages ( unittest . TestCase ) : <EOL> def _test_functional ( self , root ) : <EOL> info = os . path . join ( os . path . dirname ( __file__ ) , root + "<STR_LIT>" ) <EOL> saved_path = sys . path [ : ] <EOL> try : <EOL> sys . path . insert ( <NUM_LIT:0> , os . path . dirname ( __file__ ) ) <EOL> m = __import__ ( "<STR_LIT>" % root ) <EOL> tested = parse ( open ( info ) . read ( ) ) <EOL> self . assertEqual ( tested , m . ref , "<STR_LIT>" % info ) <EOL> finally : <EOL> sys . path = saved_path <EOL> def test_sphinx ( self ) : <EOL> self . _test_functional ( "<STR_LIT>" ) <EOL> def test_jinja2 ( self ) : <EOL> self . _test_functional ( "<STR_LIT>" ) <EOL> def test_distribute ( self ) : <EOL> self . _test_functional ( "<STR_LIT>" ) </s>
