MCPcopy Index your code
hub / github.com/clips/pattern / test_graph

Method test_graph

test/test_graph.py:151–164  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

149 self.g.add_edge("b", "c")
150
151 def test_graph(self):
152 # Assert graph properties.
153 g = self.g.copy()
154 self.assertTrue(len(g.nodes) == 3)
155 self.assertTrue(len(g.edges) == 2)
156 self.assertTrue(g.distance == 10.0)
157 self.assertTrue(g.density == 2 / 3.0)
158 self.assertTrue(g.is_complete == False)
159 self.assertTrue(g.is_sparse == False)
160 self.assertTrue(g.is_dense == True)
161 self.assertTrue(g._adjacency == None)
162 self.assertTrue(isinstance(g.layout, graph.GraphLayout))
163 self.assertTrue(isinstance(g.layout, graph.GraphSpringLayout))
164 print "pattern.graph.Graph"
165
166 def test_graph_nodes(self):
167 # Assert graph nodes.

Callers

nothing calls this directly

Calls 2

lenFunction · 0.85
copyMethod · 0.45

Tested by

no test coverage detected