def test_duplicate_test(data): new_name = actions.random_str() response = test_.duplicate_test(data.project, data.test, new_name) assert response.status_code == 200 assert response.json() == [] assert project.test_exists(data.project, new_name) assert project.test_exists(data.project, data.test)
def test_rename_test(data): test_one = project.create_random_test(data.project) new_test_name = actions.random_str() response = test_.rename_test(data.project, test_one, new_test_name) assert response.status_code == 200 assert response.json()['errors'] == [] assert not project.test_exists(data.project, test_one) assert project.test_exists(data.project, new_test_name)
def test_duplicate_name_with_invalid_name(data): new_name = 'test-{}'.format(actions.random_str()) response = test_.duplicate_test(data.project, data.test, new_name) assert response.status_code == 200 assert response.json() == [ 'Only letters, numbers and underscores are allowed' ] assert project.test_exists(data.project, data.test) assert not project.test_exists(data.project, new_name)
def test_rename_test_in_folder(data): test_two = '{}.{}'.format(actions.random_str(), actions.random_str()) project.create_test(data.project, test_two) new_test_name_two = '{}.{}'.format(actions.random_str(), actions.random_str()) response = test_.rename_test(data.project, test_two, new_test_name_two) assert response.json()['errors'] == [] assert not project.test_exists(data.project, test_two) assert project.test_exists(data.project, new_test_name_two)
def test_rename_test_with_invalid_name(data): test_name = project.create_random_test(data.project) new_name = 'test-{}'.format(actions.random_str()) response = test_.rename_test(data.project, test_name, new_name) assert response.status_code == 200 assert response.json()['errors'] == [ 'Only letters, numbers and underscores are allowed' ] assert project.test_exists(data.project, test_name) assert not project.test_exists(data.project, new_name)
def test_delete_test(data): test_one = project.create_random_test(data.project) response = test_.delete_test(data.project, test_one) assert response.status_code == 200 assert response.json() == [] assert not project.test_exists(data.project, test_one) test_two = '{}.{}'.format(actions.random_str(), actions.random_str()) project.create_test(data.project, test_two) test_.delete_test(data.project, test_two) assert not project.test_exists(data.project, test_two)
def test_rename_test_directory(data): # rename a test directory with a test inside dirname = actions.random_str() test_name = actions.random_str() test_path = '{}.{}'.format(dirname, test_name) project.create_test_directory(data.project, dirname) project.create_test(data.project, test_path) new_dir = actions.random_str() response = test_.rename_test_directory(data.project, dirname, new_dir) assert response.status_code == 200 assert response.json()['errors'] == [] assert not project.test_exists(data.project, test_path) new_test_path = '{}.{}'.format(new_dir, test_name) assert project.test_exists(data.project, new_test_path)
def test_create_test_to_subfolder(data): test_name = '{}.{}.{}'.format(actions.random_str(), actions.random_str(), actions.random_str()) response = project.create_test(data.project, test_name) assert response.json()['errors'] == [] assert project.test_exists(data.project, test_name)
def test_create_test_to_test_root_folder(data): test_name = actions.random_str() response = project.create_test(data.project, test_name) assert response.status_code == 200 assert response.json()['errors'] == [] assert project.test_exists(data.project, test_name)
def test_delete_test_directory_with_a_test_inside(data): dir_two = actions.random_str() test = '{}.{}'.format(dir_two, actions.random_str()) project.create_test(data.project, test) test_.delete_test_directory(data.project, dir_two) assert not project.test_exists(data.project, test)
def test_duplicate_test_to_another_folder(data): new_name_two = '{}.{}'.format(actions.random_str(), actions.random_str()) test_.duplicate_test(data.project, data.test, new_name_two) assert project.test_exists(data.project, new_name_two)