Beispiel #1
0
def test_move__to_group(testgroup_id):
    sheetid = calls.new_sheet('test_move__to_group-sheet', testgroup_id)
    groupid = calls.new_group('test_move__to_group-group', testgroup_id)

    calls.move(sheetid, groupid)

    group(groupid).get_sheet_by_title('test_move__to_group-sheet')
Beispiel #2
0
def test_set_group_title(testgroup_id):
    name = 'test_set_group_title'
    identifier = calls.new_group(name, testgroup_id)

    calls.set_group_title(identifier, name + TEST_STRING)

    group = calls.get_item(identifier, False)
    assert group.title == name + TEST_STRING
Beispiel #3
0
def test_trash(testgroup_id):
    identifier = calls.new_group('test_trash', testgroup_id)
    group(testgroup_id).get_group_by_title('test_trash')

    calls.trash(identifier)

    with pytest.raises(KeyError):
        group(testgroup_id).get_group_by_title('test_trash')
Beispiel #4
0
def testgroup_id(playground_id):
    """Return if of group for this tests run and destroy on completion"""

    group_name = randomword(8)
    print "Create a group in playground:", group_name
    identifier = calls.new_group(group_name, playground_id)
    yield identifier

    print 'Trash the group made in playground:', group_name
    calls.trash(identifier)
Beispiel #5
0
def test_copy__to_index(testgroup_id):
    group_id = calls.new_group('test_copy__to_index-group', testgroup_id)
    sheet1_id = calls.new_sheet('sheet0', group_id)
    calls.new_sheet('sheet2', group_id)
    calls.new_sheet('sheet1', group_id)

    calls.copy(sheet1_id, group_id, 1, silent_mode=True)

    group_ = group(group_id)
    assert group_.sheets[0].title == 'sheet1'
    assert group_.sheets[1].title == 'sheet0'
    assert group_.sheets[2].title == 'sheet2'
Beispiel #6
0
def test_move__to_index(testgroup_id):
    group_id = calls.new_group('test_move__to_index-group', testgroup_id)
    sheet1_id = calls.new_sheet('sheet1', group_id)
    calls.new_sheet('sheet2', group_id)
    group_ = group(group_id)
    assert group_.sheets[0].title == 'sheet2'
    assert group_.sheets[1].title == 'sheet1'

    calls.move(sheet1_id, index=0, silent_mode=True)

    group_ = group(group_id)
    assert group_.sheets[0].title == 'sheet1'
    assert group_.sheets[1].title == 'sheet2'
Beispiel #7
0
def test_new_group(testgroup_id):
    name = 'test_new_group' + TEST_STRING
    identifier = calls.new_group(name, testgroup_id)

    assert calls.get_item(identifier, False).title == name