Skip to content
This repository has been archived by the owner on Apr 7, 2022. It is now read-only.

Commit

Permalink
New test: test_edit_template
Browse files Browse the repository at this point in the history
  • Loading branch information
valaparthvi committed Jun 25, 2020
1 parent c535f49 commit 82cfe2e
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions cfme/tests/infrastructure/test_rest_templates.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import json

import pytest
from wrapanapi.exceptions import MultipleItemsError
from wrapanapi.exceptions import NotFoundError
Expand Down Expand Up @@ -165,3 +167,21 @@ def test_delete_template_from_collection(template):
initialEstimate: 1/4h
"""
delete_resources_from_collection([template])


@pytest.mark.parametrize("method", ["PUT", "PATCH"])
def test_edit_template(appliance, template, method):
"""
Polarion:
assignee: pvala
casecomponent: Services
caseimportance: high
initialEstimate: 1/4h
"""
payload = {"name": f"edited-{template.name}"}
getattr(appliance.rest_api._session, method.lower())(
url=template.href, data=json.dumps(payload)
)
assert_response(appliance)
template.reload()
assert template.name == payload["name"]

0 comments on commit 82cfe2e

Please sign in to comment.