Commits

Ali Afshar committed d607c1f

basic project tests

  • Participants
  • Parent commits ac2f9a5

Comments (0)

Files changed (2)

gtkarchitect/model/project.py

 
-from lxml.etree import Element
+from lxml.etree import Element, tostring
 
 from .entity import add_entity_child
 
         entity = definition.create_entity()
         self.add_entity(entity, parent)
 
+    def dump(self):
+        return tostring(self.tree)
+

tests/model/test_project.py

     p = Project()
     assert p.tree.tag == 'interface'
     assert len(p.tree) == 0
+    assert p.dump == '<interface/>'
 
 def test_simple_project():
     e = Element('interface')
     p = Project(e)
-
     assert p.tree.tag == 'interface'
     assert len(p.tree) == 0
     assert p.tree is e
+    assert p.dump == '<interface/>'
 
+def test_project_add_entity_noparent():
+    p = Project()
+    e = Element('object', **{'class':'GtkWindow'})
 
+
+
+
+