Package datk :: Package tests :: Module networks_tests
[hide private]
[frames] | no frames]

Source Code for Module datk.tests.networks_tests

 1  """ 
 2  Network Test Suite 
 3   
 4  Tests Netwoks defined in networks.py by visual inspection 
 5  """ 
 6   
 7  try: 
 8      from datk.core.networks import * 
 9      from datk.core.tester import * 
10  except ImportError: 
11      raise ImportError( 
12  """ Imports failed\n 
13  To run tests, execute the following commands: 
14  $ cd ../.. 
15  $ python -m datk.tests.networks_tests """) 
16   
17  try: 
18      __IPYTHON__ 
19      ip = get_ipython() 
20      ip.magic("%matplotlib inline")  
21  except NameError: 
22      pass 
23 24 @test(main_thread=True) 25 -def DRAW_RANDOM():
26 Random_Line_Network(25).draw()
27
28 @test(main_thread=True) 29 -def DRAW_HUGE_RANDOM():
30 Random_Line_Network(100, sparsity=0.2).draw()
31
32 @test(main_thread=True) 33 -def DRAW_UNI_RING():
34 Unidirectional_Ring(4).draw()
35
36 @test(main_thread=True) 37 -def DRAW_BI_RING():
38 Bidirectional_Ring(7).draw()
39
40 @test(main_thread=True) 41 -def DRAW_COMPLETE_GRAPH():
42 Complete_Graph(10).draw()
43
44 @test(main_thread=True) 45 -def DRAW_UNI_LINE():
46 Unidirectional_Line(4).draw()
47
48 @test(main_thread=True) 49 -def DRAW_BI_LINE():
50 Bidirectional_Line(5).draw()
51 52 summarize() 53