def get_dummy_entitytype(cursor, name): et = get_entitytype(cursor, name) if et: return et else: return create_entitytype(cursor, name, "")
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"
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"