Пример #1
0
 def test_node_attribute_xy_directed(self):
     attrxy = sorted(nx.node_attribute_xy(self.D, 'fish'))
     attrxy_result = sorted([('one', 'one'),
                             ('two', 'two'),
                             ('one', 'red'),
                             ('two', 'blue')
                             ])
     assert attrxy == attrxy_result
Пример #2
0
 def test_node_attribute_xy_directed(self):
     attrxy = sorted(nx.node_attribute_xy(self.D, 'fish'))
     attrxy_result = sorted([('one', 'one'),
                             ('two', 'two'),
                             ('one', 'red'),
                             ('two', 'blue')
                             ])
     assert_equal(attrxy, attrxy_result)
Пример #3
0
 def test_node_attribute_xy_multigraph(self):
     attrxy = sorted(nx.node_attribute_xy(self.M, 'fish'))
     attrxy_result = [('one', 'one'),
                      ('one', 'one'),
                      ('one', 'one'),
                      ('one', 'one'),
                      ('two', 'two'),
                      ('two', 'two')
                      ]
     assert_equal(attrxy, attrxy_result)
Пример #4
0
 def test_node_attribute_xy_multigraph(self):
     attrxy = sorted(nx.node_attribute_xy(self.M, 'fish'))
     attrxy_result = [('one', 'one'),
                      ('one', 'one'),
                      ('one', 'one'),
                      ('one', 'one'),
                      ('two', 'two'),
                      ('two', 'two')
                      ]
     assert attrxy == attrxy_result
Пример #5
0
 def test_node_attribute_xy_multigraph(self):
     attrxy = sorted(nx.node_attribute_xy(self.M, "fish"))
     attrxy_result = [
         ("one", "one"),
         ("one", "one"),
         ("one", "one"),
         ("one", "one"),
         ("two", "two"),
         ("two", "two"),
     ]
     assert attrxy == attrxy_result
Пример #6
0
 def test_node_attribute_xy_undirected(self):
     attrxy=sorted(nx.node_attribute_xy(self.G,'fish'))
     attrxy_result=sorted([('one','one'),
                           ('one','one'),
                           ('two','two'),
                           ('two','two'),
                           ('one','red'),
                           ('red','one'),
                           ('blue','two'),
                           ('two','blue')
                           ])
     assert_equal(attrxy,attrxy_result)
Пример #7
0
 def test_node_attribute_xy_undirected(self):
     attrxy = sorted(nx.node_attribute_xy(self.G, "fish"))
     attrxy_result = sorted([
         ("one", "one"),
         ("one", "one"),
         ("two", "two"),
         ("two", "two"),
         ("one", "red"),
         ("red", "one"),
         ("blue", "two"),
         ("two", "blue"),
     ])
     assert attrxy == attrxy_result
Пример #8
0
 def test_node_attribute_xy_undirected(self):
     attrxy = sorted(nx.node_attribute_xy(self.G, "fish"))
     attrxy_result = sorted(
         [
             ("one", "one"),
             ("one", "one"),
             ("two", "two"),
             ("two", "two"),
             ("one", "red"),
             ("red", "one"),
             ("blue", "two"),
             ("two", "blue"),
         ]
     )
     assert_equal(attrxy, attrxy_result)
 def test_node_attribute_xy_selfloop(self):
     attrxy = sorted(nx.node_attribute_xy(self.S, 'fish'))
     attrxy_result = [('one', 'one'), ('two', 'two')]
     assert attrxy == attrxy_result
 def test_node_attribute_xy_undirected_nodes(self):
     attrxy = sorted(
         nx.node_attribute_xy(self.G, 'fish', nodes=['one', 'yellow']))
     attrxy_result = sorted([])
     assert attrxy == attrxy_result
Пример #11
0
 def test_node_attribute_xy_undirected_nodes(self):
     attrxy = sorted(nx.node_attribute_xy(self.G, 'fish',
                                          nodes=['one', 'yellow']))
     attrxy_result = sorted([
     ])
     assert_equal(attrxy, attrxy_result)
Пример #12
0
 def test_node_attribute_xy_selfloop(self):
     attrxy = sorted(nx.node_attribute_xy(self.S, "fish"))
     attrxy_result = [("one", "one"), ("two", "two")]
     assert attrxy == attrxy_result
Пример #13
0
 def test_node_attribute_xy_undirected_nodes(self):
     attrxy = sorted(
         nx.node_attribute_xy(self.G, "fish", nodes=["one", "yellow"]))
     attrxy_result = sorted([])
     assert attrxy == attrxy_result
Пример #14
0
 def test_node_attribute_xy_selfloop(self):
     attrxy = sorted(nx.node_attribute_xy(self.S, "fish"))
     attrxy_result = [("one", "one"), ("two", "two")]
     assert_equal(attrxy, attrxy_result)