Completed
Pull Request — master (#487)
by
unknown
02:48
created

test_run_is_instance()   A

Complexity

Conditions 1

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
c 1
b 0
f 0
dl 0
loc 4
rs 10
1
# Licensed to the StackStorm, Inc ('StackStorm') under one or more
2
# contributor license agreements.  See the NOTICE file distributed with
3
# this work for additional information regarding copyright ownership.
4
# The ASF licenses this file to You under the Apache License, Version 2.0
5
# (the "License"); you may not use this file except in compliance with
6
# the License.  You may obtain a copy of the License at
7
#
8
#     http://www.apache.org/licenses/LICENSE-2.0
9
#
10
# Unless required by applicable law or agreed to in writing, software
11
# distributed under the License is distributed on an "AS IS" BASIS,
12
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
# See the License for the specific language governing permissions and
14
15
import yaml
16
from mock import Mock, MagicMock
17
18
from st2tests.base import BaseActionTestCase
19
20
from list_node_custom_properties import ListNodeCustomProperties
21
22
__all__ = [
23
    'ListNodeCustomProperties'
24
]
25
26
MOCK_CONFIG_BLANK = yaml.safe_load(open(
27
    'packs/orion/tests/fixture/blank.yaml').read())
28
MOCK_CONFIG_FULL = yaml.safe_load(open(
29
    'packs/orion/tests/fixture/full.yaml').read())
30
31
32
class ListNodeCustomPropertiesTestCase(BaseActionTestCase):
33
    action_cls = ListNodeCustomProperties
34
35
    def test_run_no_config(self):
36
        self.assertRaises(ValueError, ListNodeCustomProperties, MOCK_CONFIG_BLANK)
37
38
    def test_run_is_instance(self):
39
        action = self.get_action_instance(MOCK_CONFIG_FULL)
40
41
        self.assertIsInstance(action, ListNodeCustomProperties)
42