blob: 257afc565105f152c28f5c2e9627661136f113da [file] [log] [blame]
Thomas Herve55e02a02016-05-26 11:32:20 +02001# Licensed under the Apache License, Version 2.0 (the "License"); you may
2# not use this file except in compliance with the License. You may obtain
3# a copy of the License at
4#
5# http://www.apache.org/licenses/LICENSE-2.0
6#
7# Unless required by applicable law or agreed to in writing, software
8# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
9# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
10# License for the specific language governing permissions and limitations
11# under the License.
12
13from heat_integrationtests.functional import functional_base
14
15
16test_template_depend = {
17 'heat_template_version': '2013-05-23',
18 'resources': {
19 'test1': {
20 'type': 'OS::Heat::TestResource',
21 'properties': {
22 'value': 'Test1',
23 }
24 },
25 'test2': {
26 'type': 'OS::Heat::TestResource',
27 'depends_on': ['test1'],
28 'properties': {
29 'value': 'Test2',
30 }
31 }
32 }
33}
34
35
36class ResourcesList(functional_base.FunctionalTestsBase):
37
38 def test_filtering_with_depend(self):
39 stack_identifier = self.stack_create(template=test_template_depend)
40 [test2] = self.client.resources.list(stack_identifier,
41 filters={'name': 'test2'})
42
43 self.assertEqual('CREATE_COMPLETE', test2.resource_status)