def test_select_by_node_in_nodes_selection_mode(self): graph = Graph(((self.source, self.source+1), self.nodes)) selection = Graph(([(1, 2)], list(zip(*self.nodes))[1:3])) self.assertEqual(graph.select(index=(1, 3), selection_mode='nodes'), selection)
def test_select_by_edge_data(self): graph = Graph(((self.target, self.source, self.edge_info),), vdims=['info']) selection = Graph(([(0, 0, 0), (0, 1, 1)], list(zip(*self.nodes))[:2]), vdims=['info']) self.assertEqual(graph.select(info=(0, 2)), selection)
def test_select_by_node_in_edges_selection_mode(self): graph = Graph(((self.source, self.target),)) selection = Graph(([(1, 0), (2, 0)], list(zip(*self.nodes))[0:3])) self.assertEqual(graph.select(index=(1, 3)), selection)
def test_select_by_target(self): graph = Graph(((self.source, self.target),)) selection = Graph(([(0,0), (1, 0)], list(zip(*self.nodes))[:2])) self.assertEqual(graph.select(start=(0, 2)), selection)
def test_select_by_source_and_target(self): graph = Graph(((self.source, self.source+1), self.nodes)) selection = Graph(([(0,1)], list(zip(*self.nodes))[:2])) self.assertEqual(graph.select(start=(0, 3), end=1), selection)
def test_select_by_edge_data(self): graph = Graph(((self.target, self.source, self.edge_info), ), vdims=['info']) selection = Graph(([(0, 0, 0), (0, 1, 1)], list(zip(*self.nodes))[:2]), vdims=['info']) self.assertEqual(graph.select(info=(0, 2)), selection)
def test_select_by_source_and_target(self): graph = Graph(((self.source, self.source + 1), self.nodes)) selection = Graph(([(0, 1)], list(zip(*self.nodes))[:2])) self.assertEqual(graph.select(start=(0, 3), end=1), selection)
def test_select_by_target(self): graph = Graph(((self.source, self.target), )) selection = Graph(([(0, 0), (1, 0)], list(zip(*self.nodes))[:2])) self.assertEqual(graph.select(start=(0, 2)), selection)