Exemplo n.º 1
0
 def test_constructor_with_nodes_and_paths_dimension_mismatch(self):
     paths = Graph(((self.source, self.target), self.nodes)).edgepaths
     exception = 'Ensure that the first two key dimensions on Nodes and EdgePaths match: x != x2'
     with self.assertRaisesRegex(ValueError, exception):
         Graph(
             ((self.source, self.target), self.nodes, paths.redim(x='x2')))
Exemplo n.º 2
0
 def test_constructor_with_nodes_and_paths_dimension_mismatch(self):
     paths = Graph(((self.source, self.target), self.nodes)).edgepaths
     exception = 'Ensure that the first two key dimensions on Nodes and EdgePaths match: x != x2'
     with self.assertRaisesRegexp(ValueError, exception):
         Graph(((self.source, self.target), self.nodes, paths.redim(x='x2')))
Exemplo n.º 3
0
 def test_graph_redim_nodes(self):
     graph = Graph(((self.target, self.source), ))
     redimmed = graph.redim(x='x2', y='y2')
     self.assertEqual(redimmed.nodes, graph.nodes.redim(x='x2', y='y2'))
     self.assertEqual(redimmed.edgepaths,
                      graph.edgepaths.redim(x='x2', y='y2'))
Exemplo n.º 4
0
 def test_graph_redim_nodes(self):
     graph = Graph(((self.target, self.source),))
     redimmed = graph.redim(x='x2', y='y2')
     self.assertEqual(redimmed.nodes, graph.nodes.redim(x='x2', y='y2'))
     self.assertEqual(redimmed.edgepaths, graph.edgepaths.redim(x='x2', y='y2'))