<s> import unittest <EOL> import random <EOL> import types <EOL> import networkx <EOL> from zen import * <EOL> class ToNetworkXTestCase ( unittest . TestCase ) : <EOL> def test_return_types ( self ) : <EOL> Gu = Graph ( ) <EOL> Gd = DiGraph ( ) <EOL> self . assertTrue ( type ( to_networkx ( Gu ) ) == networkx . Graph ) <EOL> self . assertTrue ( type ( to_networkx ( Gd ) ) == networkx . DiGraph ) <EOL> def test_basic_udir ( self ) : <EOL> G = Graph ( ) <EOL> G . add_edge ( <NUM_LIT:1> , '<STR_LIT:hello>' ) <EOL> G . add_edge ( '<STR_LIT:hello>' , <NUM_LIT:0> ) <EOL> Gnx = to_networkx ( G ) <EOL> assert <NUM_LIT:1> in Gnx <EOL> assert '<STR_LIT:hello>' in Gnx <EOL> assert True in Gnx <EOL> assert Gnx . has_edge ( <NUM_LIT:1> , '<STR_LIT:hello>' ) <EOL> assert not Gnx . has_edge ( <NUM_LIT:1> , <NUM_LIT:0> ) <EOL> assert Gnx . has_edge ( '<STR_LIT:hello>' , <NUM_LIT:0> ) <EOL> assert Gnx . has_edge ( <NUM_LIT:0> , '<STR_LIT:hello>' ) <EOL> def test_basic_dir ( self ) : <EOL> G = DiGraph ( ) <EOL> G . add_edge ( <NUM_LIT:1> , '<STR_LIT:hello>' ) <EOL> G . add_edge ( '<STR_LIT:hello>' , <NUM_LIT:0> ) <EOL> Gnx = to_networkx ( G ) <EOL> assert <NUM_LIT:1> in Gnx <EOL> assert '<STR_LIT:hello>' in Gnx <EOL> assert True in Gnx <EOL> assert Gnx . has_edge ( <NUM_LIT:1> , '<STR_LIT:hello>' ) <EOL> assert not Gnx . has_edge ( <NUM_LIT:1> , <NUM_LIT:0> ) <EOL> assert Gnx . has_edge ( '<STR_LIT:hello>' , <NUM_LIT:0> ) <EOL> assert not Gnx . has_edge ( <NUM_LIT:0> , '<STR_LIT:hello>' ) <EOL> if __name__ == '<STR_LIT:__main__>' : <EOL> unittest . main ( ) </s>
