Home | History | Annotate | Download | only in tests
      1 #!/usr/bin/env python
      2 from nose.tools import *
      3 import networkx as nx
      4 
      5 class TestIntersectionGraph():
      6     def test_random_intersection_graph(self):
      7         G=nx.uniform_random_intersection_graph(10,5,0.5)
      8         assert_equal(len(G),10)
      9 
     10     def test_k_random_intersection_graph(self):
     11         G=nx.k_random_intersection_graph(10,5,2)
     12         assert_equal(len(G),10)
     13 
     14     def test_general_random_intersection_graph(self):
     15         G=nx.general_random_intersection_graph(10,5,[0.1,0.2,0.2,0.1,0.1])
     16         assert_equal(len(G),10)
     17         assert_raises(ValueError, nx.general_random_intersection_graph,10,5,
     18                       [0.1,0.2,0.2,0.1])
     19 
     20