# Path: godot/api.py



import unittest
from godot.api \
    import Graph, Subgraph, Cluster, Node, Edge
        """ Test adding nodes with existing names.
        """
        g = Graph()
        g.add_node("a", label="test1")
        g.add_node("a", fixedsize=True)
        g.add_node("a", label="test2", shape="circle")
        self.assertEqual(len(g), 1)

        n = g.get_node("a")
        self.assertTrue(n.fixedsize)
        self.assertEqual(n.label, "test2")
        self.assertEqual(n.shape, "circle")


    def test_add_nonstring_nodes(self):
        """ Test adding nodes with non-string names.
        """
        g = Graph()
        n = g.add_node(6)
        self.assertEqual(n.ID, "6")
        n = g.add_node(3.14)
        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")

# Path: godot/api.py



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

        """ Test adding nodes with existing names.
        """
        g = Graph()
        g.add_node("a", label="test1")
        g.add_node("a", fixedsize=True)
        g.add_node("a", label="test2", shape="circle")
        self.assertEqual(len(g), 1)

        n = g.get_node("a")
        self.assertTrue(n.fixedsize)
        self.assertEqual(n.label, "test2")
        self.assertEqual(n.shape, "circle")


    def test_add_nonstring_nodes(self):
        """ Test adding nodes with non-string names.
        """
        g = Graph()
        n = g.add_node(6)
        self.assertEqual(n.ID, "6")
        n = g.add_node(3.14)
        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) )