Source

gtkarchitect-main / tests / model / test_project.py

Full commit

from gtkarchitect.model.project import Project
from gtkarchitect.model.entity import Element


def test_empty_project():
    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'})