Ejemplo n.º 1
0
def get_dummy_entitytype(cursor, name):
    et = get_entitytype(cursor, name)

    if et:
        return et
    else:
        return create_entitytype(cursor, name, "")
Ejemplo n.º 2
0
def test_get_entitytype(conn):
    with closing(conn.cursor()) as cursor:
        new_entitytype = helpers_v4.create_entitytype(cursor, "test_get_entitytype", "short description of type")

        entitytype = helpers_v4.get_entitytype(cursor, "test_get_entitytype")

    assert entitytype.id == new_entitytype.id
    assert entitytype.name == "test_get_entitytype"
Ejemplo n.º 3
0
def test_create_entitytype(conn):
    with closing(conn.cursor()) as cursor:
        entitytype = helpers_v4.create_entitytype(cursor, "test_create_entitytype", "short description of type")

    assert not entitytype.id is None
    assert entitytype.name == "test_create_entitytype"