def test_duplicate_suite_name_already_exists(self, project_session, test_utils): _, project = project_session.activate() suite_name = test_utils.create_random_suite(project) suite_name_two = test_utils.create_random_suite(project) errors = suite.duplicate_suite(project, suite_name, suite_name_two) assert errors == ['A suite with that name already exists']
def suite_duplicate(): project = request.json['project'] page_name = request.json['fullPath'] new_page_name = request.json['newFileFullPath'] _verify_permissions(Permissions.STANDARD, project) errors = suite_module.duplicate_suite(project, page_name, new_page_name) return jsonify(errors)
def test_duplicate_suite(self, project_session, test_utils): _, project = project_session.activate() suite_name = test_utils.create_random_suite(project) new_suite_name = test_utils.random_string() errors = suite.duplicate_suite(project, suite_name, new_suite_name) assert errors == [] suites = Project(project).suites() assert suite_name in suites assert new_suite_name in suites
def test_duplicate_suite_same_name(self, project_session, test_utils): _, project = project_session.activate() suite_name = test_utils.create_random_suite(project) errors = suite.duplicate_suite(project, suite_name, suite_name) assert errors == ['New suite name cannot be the same as the original']
def test_duplicate_suite_invalid_name(self, project_session, test_utils): _, project = project_session.activate() suite_name = test_utils.create_random_suite(project) new_suite_name = 'new-name' errors = suite.duplicate_suite(project, suite_name, new_suite_name) assert errors == ['Only letters, numbers and underscores are allowed']