From 82cfe2e8e35d6228e7666b2fa09263de3d4a5865 Mon Sep 17 00:00:00 2001 From: Parthvi Vala Date: Thu, 25 Jun 2020 15:50:00 +0530 Subject: [PATCH] New test: test_edit_template --- .../infrastructure/test_rest_templates.py | 20 +++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/cfme/tests/infrastructure/test_rest_templates.py b/cfme/tests/infrastructure/test_rest_templates.py index cbd38a594f..4c18e68a1f 100644 --- a/cfme/tests/infrastructure/test_rest_templates.py +++ b/cfme/tests/infrastructure/test_rest_templates.py @@ -1,3 +1,5 @@ +import json + import pytest from wrapanapi.exceptions import MultipleItemsError from wrapanapi.exceptions import NotFoundError @@ -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"]