Fixing api test with default missing restriction type
Change-Id: Idf5b6e11342b5832ff6c62a47641e7b9fde97554
This commit is contained in:
parent
f375f0caa4
commit
303291bf17
|
@ -326,6 +326,7 @@ class TestServiceActions(base.TestBase):
|
|||
self.restrictions_list = [
|
||||
{
|
||||
u"name": u"website only",
|
||||
u"type": u"whitelist",
|
||||
u"rules": [
|
||||
{
|
||||
u"name": domain,
|
||||
|
|
|
@ -154,6 +154,8 @@ class TestPatchSSLService(base.TestBase):
|
|||
|
||||
self.restrictions_list = [
|
||||
{"name": "website only",
|
||||
# add whitelist to make restriction type explicit
|
||||
"type": "whitelist",
|
||||
"rules": [{"name": "mywebsite.com",
|
||||
"referrer": "www.mywebsite.com",
|
||||
"request_url": "/*"
|
||||
|
@ -203,6 +205,12 @@ class TestPatchSSLService(base.TestBase):
|
|||
patch = jsonpatch.JsonPatch(test_data)
|
||||
expected_service_details = patch.apply(self.original_service_details)
|
||||
|
||||
# Default restriction to whitelist
|
||||
expected_restrictions = expected_service_details['restrictions']
|
||||
for restriction in expected_restrictions:
|
||||
if 'type' not in restriction:
|
||||
restriction['type'] = 'whitelist'
|
||||
|
||||
resp = self.client.patch_service(location=self.service_url,
|
||||
request_body=test_data)
|
||||
self.assertEqual(resp.status_code, 202)
|
||||
|
|
Loading…
Reference in New Issue