# Path: godot/api.py



import unittest
from godot.api \
    import Graph, Subgraph, Cluster, Node, Edge
#  "GraphTestCase" class:
#------------------------------------------------------------------------------

class GraphTestCase(unittest.TestCase):
    """ Defines a test case for Godot graph objects.
    """

    def test_create(self):
        """ Test creation of a graph.
        """
        g = Graph(name="graph", strict=True, directed=False)
        self.failUnless(g.name == "graph")
        self.assertTrue(g.strict)
        self.assertFalse(g.directed)


    def test_create_with_attributes(self):
        """ Test creation of a graph with attributes.
        """
        g = Graph(mode="KK", label="testgraph")
        self.assertEqual(g.mode, "KK")
        self.assertEqual(g.label, "testgraph")


    def test_add_node(self):
        """ Test adding nodes to a graph.
        """
        g = Graph()
        g.nodes.append( Node(ID="node1") )
        g.add_node("node2")

# Path: godot/api.py



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

#  "GraphTestCase" class:
#------------------------------------------------------------------------------

class GraphTestCase(unittest.TestCase):
    """ Defines a test case for Godot graph objects.
    """

    def test_create(self):
        """ Test creation of a graph.
        """
        g = Graph(name="graph", strict=True, directed=False)
        self.failUnless(g.name == "graph")
        self.assertTrue(g.strict)
        self.assertFalse(g.directed)


    def test_create_with_attributes(self):
        """ Test creation of a graph with attributes.
        """
        g = Graph(mode="KK", label="testgraph")
        self.assertEqual(g.mode, "KK")
        self.assertEqual(g.label, "testgraph")


    def test_add_node(self):
        """ Test adding nodes to a graph.
        """
        g = Graph()
        g.nodes.append( Node(ID="node1") )
        g.add_node("node2")

        g.add_node( Node("node3") )