from model.group import Group


def test_modify_group_name(app):
    if app.group.count() == 0:
        app.group.create(Group(name="test"))
    old_groups = app.group.get_group_list()
    app.group.modify_first_group(Group(name="New group"))
    new_groups = app.group.get_group_list()
    assert len(old_groups) == len(new_groups)



def test_modify_group_header(app):
    if app.group.count() == 0:
        app.group.create(Group(header="test"))
    old_groups = app.group.get_group_list()
    app.group.modify_first_group(Group(header="New header"))
    new_groups = app.group.get_group_list()
    assert len(old_groups) == len(new_groups)




[((218, 241), 'model.group.Group', 'Group', ([], {'name': '"""New group"""'}), "(name='New group')\n", (223, 241), False, 'from model.group import Group\n'), ((526, 552), 'model.group.Group', 'Group', ([], {'header': '"""New header"""'}), "(header='New header')\n", (531, 552), False, 'from model.group import Group\n'), ((121, 139), 'model.group.Group', 'Group', ([], {'name': '"""test"""'}), "(name='test')\n", (126, 139), False, 'from model.group import Group\n'), ((427, 447), 'model.group.Group', 'Group', ([], {'header': '"""test"""'}), "(header='test')\n", (432, 447), False, 'from model.group import Group\n')]