Skip to content

Commit

Permalink
add api test for update workflow with empty name
Browse files Browse the repository at this point in the history
  • Loading branch information
ahmedhamidawan committed Nov 16, 2023
1 parent ea8cffd commit 3da9c41
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions lib/galaxy_test/api/test_workflows.py
Original file line number Diff line number Diff line change
Expand Up @@ -849,6 +849,24 @@ def test_update_name(self):
workflow_dict = self.workflow_populator.download_workflow(workflow_id)
assert workflow_dict["license"] == "AAL"

def test_update_name_empty(self):
# Update doesn't allow empty names.

# Load a workflow with a given name.
original_name = "test update name"
workflow_object = self.workflow_populator.load_workflow(name=original_name)
upload_response = self.__test_upload(workflow=workflow_object, name=original_name)
workflow = upload_response.json()
assert workflow["name"] == original_name

# Try to update the name to an empty string (also change steps to force an update).
data = {"name": "", "steps": {}}
update_response = self._update_workflow(workflow["id"], data)
assert update_response.json()["err_msg"] == "Workflow must have a valid name"
self._assert_status_code_is(update_response, 400)
workflow_dict = self.workflow_populator.download_workflow(workflow["id"])
assert workflow_dict["name"] == original_name

def test_refactor(self):
workflow_id = self.workflow_populator.upload_yaml_workflow(
"""
Expand Down

0 comments on commit 3da9c41

Please sign in to comment.