Did I find the right examples for you? yes no      Crawl my project      Python Jobs

All Samples(16)  |  Call(14)  |  Derive(0)  |  Import(2)

src/b/i/biopython-1.63/Tests/test_Pathway.py   biopython(Download)
from Bio.Pathway import Reaction
from Bio.Pathway.Rep.Graph import Graph
from Bio.Pathway.Rep.MultiGraph import MultiGraph
 
 
    def testEquals(self):
        a = MultiGraph(['a', 'b', 'c'])
        a.add_edge('a', 'b', 'label1')
        a.add_edge('b', 'c', 'label1')
        a.add_edge('b', 'a', 'label2')
        b = MultiGraph(['a', 'b', 'c'])
        b.add_edge('b', 'a', 'label2')
        self.assertEqual(a, b, "not equal to similar")
        c = MultiGraph(['a', 'b', 'c'])
        c.add_edge('a', 'b', 'label2')
        c.add_edge('b', 'c', 'label2')
    def testNodes(self):
        a = MultiGraph()
        self.assertEqual(a.nodes(), [], "default graph not empty")
        a.add_node('a')
        self.assertEqual(a.nodes(), ['a'], "one node not added")

src/b/i/biopython-HEAD/Tests/test_Pathway.py   biopython(Download)
from Bio.Pathway import Reaction
from Bio.Pathway.Rep.Graph import Graph
from Bio.Pathway.Rep.MultiGraph import MultiGraph
 
 
    def testEquals(self):
        a = MultiGraph(['a', 'b', 'c'])
        a.add_edge('a', 'b', 'label1')
        a.add_edge('b', 'c', 'label1')
        a.add_edge('b', 'a', 'label2')
        b = MultiGraph(['a', 'b', 'c'])
        b.add_edge('b', 'a', 'label2')
        self.assertEqual(a, b, "not equal to similar")
        c = MultiGraph(['a', 'b', 'c'])
        c.add_edge('a', 'b', 'label2')
        c.add_edge('b', 'c', 'label2')
    def testNodes(self):
        a = MultiGraph()
        self.assertEqual(a.nodes(), [], "default graph not empty")
        a.add_node('a')
        self.assertEqual(a.nodes(), ['a'], "one node not added")