Beispiel #1
0
 def test_add_non_directed_edge(self):
     g = Grafellow()
     g.add_non_directed_edge('zach', 'person', 'laura', 'person', edge_type='friends')
     self.assertTrue(g.get_node('zach','person') == {})
     self.assertTrue(g.get_node('laura','person') == {})
     self.assertTrue('laura' in g.node_edges('zach', 'person', other_node_type='person'))
Beispiel #2
0
 def test_add_node_with_data(self):
     g = Grafellow()
     attrs = {'languages': ['python', 'ruby', 'others']}
     self.assertTrue(g.add_node('zach', 'person', attrs))
     self.assertTrue(g.get_node('zach','person'))