Exemplo n.º 1
0
def playground_id():
    """Return id of pre-existing playground group."""

    icloud_grp = calls.get_root_items(recursive=False)[0]
    assert icloud_grp.title == 'iCloud'
    icloud_grp = calls.get_item(icloud_grp.identifier, True)
    return icloud_grp.get_group_by_title(PLAYGROUND_NAME).identifier
Exemplo n.º 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
Exemplo n.º 3
0
def test_set_sheet_title_with_underscores(testgroup_id):
    title = 'tests-set-sheet-title'
    identifier = calls.new_sheet(title, testgroup_id)
    new_title = title + TEST_STRING

    calls.set_sheet_title(identifier, new_title, 'heading2')

    sheet = calls.get_item(identifier)
    assert sheet.title == new_title
    assert sheet.titleType == 'heading2'
Exemplo n.º 4
0
def group(identifier):
    return calls.get_item(identifier, recursive=True)
Exemplo n.º 5
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
Exemplo n.º 6
0
def test_check_playground_exists(playground_id):
    item = calls.get_item(playground_id, recursive=False)
    assert item.type == 'group'
    assert item.title == PLAYGROUND_NAME
Exemplo n.º 7
0
def test_get_item_fails():
    identifier = 'x' * 22
    with pytest.raises(calls.UlyssesError):
        calls.get_item(identifier)