Make test allowed_pattern type same as the hot example and fix the gate

This reverts commit 51818f07d1 and forward
ports the testing change from stable pike:

In murano allowed_pattern set as:
allowed_pattern: [A-Za-z0-9]
But in hot example is set as:
allowed_pattern: '[a-zA-Z0-9]*'

So change the test template allowed_pattern.

Change-Id: I89ac4ef9de5eb0a5176c9df2ce1f289ca0d2cc65
(cherry picked from commit a682d5ee92)
This commit is contained in:
Tony Breeds 2018-03-13 15:13:13 +11:00 committed by zhurong
parent 04c809cce1
commit 0e439d9a8d
4 changed files with 8 additions and 8 deletions

View File

@ -16,7 +16,7 @@ parameters:
description: Range Description
- allowed_values: [0, 1, 2, 3, 4]
description: Allowed Values Description
- allowed_pattern: [A-Za-z0-9]
- allowed_pattern: "[A-Za-z0-9]"
description: Allowed Pattern Description
bar:
type: boolean
@ -51,7 +51,7 @@ parameter_groups:
description: Range Description
- allowed_values: [0, 1, 2, 3, 4]
description: Allowed Values Description
- allowed_pattern: [A-Za-z0-9]
- allowed_pattern: "[A-Za-z0-9]"
description: Allowed Pattern Description
bar:
type: boolean

View File

@ -11,7 +11,7 @@ parameters:
max: 50
- length:
min: 0
- allowed_pattern: [A-Za-z0-9]
- allowed_pattern: "[A-Za-z0-9]"
param3:
type: number
constraints:

View File

@ -16,7 +16,7 @@ parameters:
description: Range Description
- allowed_values: [0, 1, 2, 3, 4]
description: Allowed Values Description
- allowed_pattern: [A-Za-z0-9]
- allowed_pattern: "[A-Za-z0-9]"
description: Allowed Pattern Description
bar:
type: boolean
@ -51,7 +51,7 @@ parameter_groups:
description: Range Description
- allowed_values: [0, 1, 2, 3, 4]
description: Allowed Values Description
- allowed_pattern: [A-Za-z0-9]
- allowed_pattern: "[A-Za-z0-9]"
description: Allowed Pattern Description
bar:
type: boolean

View File

@ -111,9 +111,9 @@ class TestHotPackage(test_base.MuranoTestCase):
param6 = params['Contract']['param6']
self.assertEqual("$.bool().check($ in list(True, False))", param1.expr)
self.assertTrue("$.string().check($ in list('bar'))."
"check(len($) <= 50).check(len($) >= 0)."
"check(matches($, '['A-Za-z0-9']'))", param2.expr)
self.assertEqual("$.string().check($ in list('bar'))."
"check(len($) <= 50).check(len($) >= 0)."
"check(matches($, '[A-Za-z0-9]'))", param2.expr)
self.assertEqual("$.int().check($ in list(0, 1, 2, 3, 4))"
".check(len($) >= 0 and len($) <= 5)."
"check($ >= 0 and $ <= 4)", param3.expr)