def test_delete_test(self, project_session, test_utils): _, project = project_session.activate() test_one = test_utils.random_string() test_two = '{}.{}'.format(test_utils.random_string(), test_utils.random_string()) test_utils.create_test(project, test_one) test_utils.create_test(project, test_two) errors_one = test_module.delete_test(project, test_one) errors_two = test_module.delete_test(project, test_two) assert errors_one == [] assert errors_two == [] assert not os.path.isfile(Test(project, test_one).path) assert not os.path.isfile(Test(project, test_two).path)
def test_delete_test_with_data(self, project_session, test_utils): """"test that when a test is deleted the data files are deleted as well """ _, project = project_session.activate() test_name = test_utils.create_random_test(project) data_path = os.path.splitext(test_module.Test(project, test_name).path)[0] + '.csv' open(data_path, 'x').close() errors = test_module.delete_test(project, test_name) assert errors == [] assert not os.path.isfile(data_path)
def test_delete(): project = request.json['project'] test_name = request.json['fullPath'] _verify_permissions(Permissions.ADMIN, project) errors = test_module.delete_test(project, test_name) return jsonify(errors)
def test_delete_test_not_exist(self, project_session): _, project = project_session.activate() errors = test_module.delete_test(project, 'not-exist') assert errors == ['Test not-exist does not exist']