Add uri in Plan yaml response

We now return the plan uri in the response of Plan on POST/PUT/GET methods,
so when the CLI does "solum app create plan.yaml" the uri field can be filled.

Closes-bug: #1331526
Change-Id: I86777c18010f356526656d13ce7798d092e0c815
This commit is contained in:
Pierre Padrixe
2014-06-18 01:22:21 +02:00
parent 4f0b678435
commit c027347749
2 changed files with 20 additions and 6 deletions

View File

@@ -13,6 +13,7 @@
# under the License.
import mock
import pecan
import yaml
from solum.api.controllers.v1.datamodel import plan as planmodel
@@ -31,6 +32,12 @@ class TestPlanController(base.BaseTestCase):
super(TestPlanController, self).setUp()
objects.load()
def test_yaml_content(self, PlanHandler, resp_mock, request_mock):
m = fakes.FakePlan()
ref_content = plan.yaml_content(m)
self.assertEqual(ref_content['uri'], '%s/v1/plans/%s' %
(pecan.request.host_url, m.uuid))
def test_plan_get(self, PlanHandler, resp_mock, request_mock):
hand_get = PlanHandler.return_value.get
fake_plan = fakes.FakePlan()