Ejemplo n.º 1
0
def test(data):
    page = actions.random_str()
    response = project.get_page_exists(data.project, page)
    assert response.json() is False
    project.create_page(data.project, page)
    response = project.get_page_exists(data.project, page)
    assert response.json() is True
Ejemplo n.º 2
0
def test(data):
    new_page_name = actions.random_str()
    response = page.rename_page(data.project, data.page, new_page_name)
    assert response.status_code == 200
    assert response.json()['errors'] == []
    assert not project.get_page_exists(data.project, data.page).json()
    assert project.get_page_exists(data.project, new_page_name).json()
Ejemplo n.º 3
0
def test(data):
    new_name = 'invalid-{}'.format(actions.random_str())
    response = page.duplicate_page(data.project, data.page, new_name)
    assert response.json() == [
        'Only letters, numbers and underscores are allowed'
    ]
    assert project.get_page_exists(data.project, data.page).json()
    assert not project.get_page_exists(data.project, new_name).json()
Ejemplo n.º 4
0
def test(data):
    # rename page
    new_dir = actions.random_str()
    response = page.rename_page_directory(data.project, data.dir, new_dir)
    assert response.status_code == 200
    assert response.json()['errors'] == []
    # old page does not exist
    assert not project.get_page_exists(data.project, data.page_full).json()
    # new page exists
    page_full = '{}.{}'.format(new_dir, data.page_name)
    assert project.get_page_exists(data.project, page_full).json()
Ejemplo n.º 5
0
def test(data):
    page = actions.random_str()
    response = project.create_page(data.project, page)
    assert response.status_code == 200
    assert response.json()['errors'] == []
    assert project.get_page_exists(data.project, page).json()
Ejemplo n.º 6
0
def test(data):
    response = page.delete_page(data.project, data.page)
    assert response.status_code == 200
    assert response.json() == []
    assert not project.get_page_exists(data.project, data.page).json()
Ejemplo n.º 7
0
def test(data):
    new_page_name = actions.random_str()
    response = page.duplicate_page(data.project, data.page, new_page_name)
    assert response.status_code == 200
    assert response.json() == []
    assert project.get_page_exists(data.project, new_page_name).json()