<s> import unittest <EOL> import networkx <EOL> import os <EOL> import pythonect . internal . parsers . vdx <EOL> BASE_DIR = os . path . join ( os . path . dirname ( __file__ ) , os . pardir ) <EOL> TEST_DIR = os . path . dirname ( os . path . abspath ( __file__ ) ) <EOL> class TestPythonectVisioParser ( unittest . TestCase ) : <EOL> def test_program_empty ( self ) : <EOL> g = networkx . DiGraph ( ) <EOL> self . assertEqual ( len ( pythonect . internal . parsers . vdx . PythonectVisioParser ( ) . parse ( open ( TEST_DIR + os . sep + '<STR_LIT>' + os . sep + '<STR_LIT>' ) . read ( ) ) . nodes ( ) ) == len ( g . nodes ( ) ) , True ) <EOL> def test_expr_atom ( self ) : <EOL> g = networkx . DiGraph ( ) <EOL> g . add_node ( '<STR_LIT:1>' ) <EOL> self . assertEqual ( len ( pythonect . internal . parsers . vdx . PythonectVisioParser ( ) . parse ( open ( TEST_DIR + os . sep + '<STR_LIT>' + os . sep + '<STR_LIT>' ) . read ( ) ) . nodes ( ) ) == len ( g . nodes ( ) ) , True ) <EOL> def test_even_expr_atom_op_expr ( self ) : <EOL> g = networkx . DiGraph ( ) <EOL> g . add_node ( '<STR_LIT:1>' ) <EOL> g . add_node ( '<STR_LIT:2>' ) <EOL> g . add_edge ( '<STR_LIT:1>' , '<STR_LIT:2>' ) <EOL> self . assertEqual ( len ( pythonect . internal . parsers . vdx . PythonectVisioParser ( ) . parse ( open ( TEST_DIR + os . sep + '<STR_LIT>' + os . sep + '<STR_LIT>' ) . read ( ) ) . edges ( ) ) == len ( g . edges ( ) ) , True ) <EOL> def test_odd_expr_atom_op_expr ( self ) : <EOL> g = networkx . DiGraph ( ) <EOL> g . add_node ( '<STR_LIT:1>' ) <EOL> g . add_node ( '<STR_LIT:2>' ) <EOL> g . add_node ( '<STR_LIT:3>' ) <EOL> g . add_edge ( '<STR_LIT:1>' , '<STR_LIT:2>' ) <EOL> g . add_edge ( '<STR_LIT:2>' , '<STR_LIT:3>' ) <EOL> self . assertEqual ( len ( pythonect . internal . parsers . vdx . PythonectVisioParser ( ) . parse ( open ( TEST_DIR + os . sep + '<STR_LIT>' + os . sep + '<STR_LIT>' ) . read ( ) ) . edges ( ) ) == len ( g . edges ( ) ) , True ) <EOL> def test_program_expr_list ( self ) : <EOL> g = networkx . DiGraph ( ) <EOL> g . add_node ( '<STR_LIT:1>' ) <EOL> g . add_node ( '<STR_LIT:2>' ) <EOL> self . assertEqual ( len ( pythonect . internal . parsers . vdx . PythonectVisioParser ( ) . parse ( open ( TEST_DIR + os . sep + '<STR_LIT>' + os . sep + '<STR_LIT>' ) . read ( ) ) . nodes ( ) ) == len ( g . nodes ( ) ) , True ) </s>
