Merge "Order type property should be required"

This commit is contained in:
Jenkins 2015-08-19 01:06:29 +00:00 committed by Gerrit Code Review
commit 37527ae828
2 changed files with 13 additions and 0 deletions

View File

@ -85,6 +85,7 @@ class Order(resource.Resource):
'key', 'asymmetric', 'certificate'
]),
],
required=True,
support_status=support.SupportStatus(version='5.0.0'),
),
REQUEST_TYPE: properties.Schema(

View File

@ -11,6 +11,8 @@
# License for the specific language governing permissions and limitations
# under the License.
import copy
import mock
import six
@ -33,6 +35,7 @@ resources:
algorithm: aes
bit_length: 256
mode: cbc
type: key
'''
@ -83,6 +86,15 @@ class TestOrder(common.HeatTestCase):
self.assertEqual('cbc', args['mode'])
self.assertEqual(256, args['bit_length'])
def test_create_order_without_type_fail(self):
snippet = copy.deepcopy(self.res_template)
del snippet['Properties']['type']
self.assertRaisesRegexp(exception.ResourceFailure,
'Property type not assigned',
self._create_resource,
'foo',
snippet, self.stack)
def test_attributes(self):
mock_order = mock.Mock()
mock_order.status = 'test-status'