# Path: godot/api.py



import unittest
from godot.api \
    import Graph, Subgraph, Cluster, Node, Edge
        self.assertEqual(n.ID, "3.14")
        self.assertEqual(len(g), 2)


    def test_add_edge(self):
        """ Test adding edges to a graph.
        """
        g = Graph()
        n1, n2, n3 = Node("N1"), Node("N2"), Node("N3")
        g.edges.append( Edge(n1, n2) )
        g.add_edge("tail", "head", label="edge1")
        g.add_edge(n2, n3, color="blue")

        self.assertEqual(len(g.edges), 3)
        self.assertEqual(g.edges[1].label, "edge1")


    def test_add_subgraph(self):
        """ Test adding subgraphs to a graph.
        """
        g = Graph()
        subgraph = Subgraph(ID="sub1", level=1)
        g.add_subgraph(subgraph)
        g.add_subgraph("sub2")
        self.assertEqual(len(g.subgraphs), 2)


    def test_add_cluster(self):
        """ Test adding clusters to a graph.
        """

# Path: godot/api.py



# Path: godot/test/graph_test_case.py
import unittest
from godot.api \
    import Graph, Subgraph, Cluster, Node, Edge

        self.assertEqual(n.ID, "3.14")
        self.assertEqual(len(g), 2)


    def test_add_edge(self):
        """ Test adding edges to a graph.
        """
        g = Graph()
        n1, n2, n3 = Node("N1"), Node("N2"), Node("N3")
        g.edges.append( Edge(n1, n2) )
        g.add_edge("tail", "head", label="edge1")
        g.add_edge(n2, n3, color="blue")

        self.assertEqual(len(g.edges), 3)
        self.assertEqual(g.edges[1].label, "edge1")


    def test_add_subgraph(self):
        """ Test adding subgraphs to a graph.
        """
        g = Graph()
        subgraph = Subgraph(ID="sub1", level=1)
        g.add_subgraph(subgraph)
        g.add_subgraph("sub2")
        self.assertEqual(len(g.subgraphs), 2)


    def test_add_cluster(self):
        """ Test adding clusters to a graph.
        """

        g = Graph()