File tree Expand file tree Collapse file tree 2 files changed +8
-9
lines changed Expand file tree Collapse file tree 2 files changed +8
-9
lines changed Original file line number Diff line number Diff line change @@ -714,7 +714,7 @@ def test_call_docker():
714
714
'{"hookStatus": "SUCCESS"}__CFN_HOOK_END_RESPONSE__'
715
715
)
716
716
mock_client .containers .run .return_value = str .encode (response_str )
717
- with patch_creds :
717
+ with patch_creds , patch_config :
718
718
status , response = hook_client .call (
719
719
"CREATE_PRE_PROVISION" , HOOK_TARGET_TYPE_NAME , {"foo" : "bar" }
720
720
)
Original file line number Diff line number Diff line change @@ -21,13 +21,15 @@ def setup_function():
21
21
TypeConfiguration .TYPE_CONFIGURATION = None
22
22
23
23
24
+ def teardown_function ():
25
+ # Rest after to clean TypeConfiguration before the next test
26
+ TypeConfiguration .TYPE_CONFIGURATION = None
27
+
28
+
24
29
def test_get_type_configuration_with_not_exist_file ():
25
30
with patch ("builtins.open" , mock_open ()) as f :
26
31
f .side_effect = FileNotFoundError ()
27
- try :
28
- TypeConfiguration .get_type_configuration ()
29
- except FileNotFoundError :
30
- pass
32
+ assert TypeConfiguration .get_type_configuration () is None
31
33
32
34
33
35
@patch ("builtins.open" , mock_open (read_data = TYPE_CONFIGURATION_TEST_SETTING ))
@@ -73,7 +75,4 @@ def test_get_hook_configuration_with_invalid_json():
73
75
def test_get_hook_configuration_with_not_exist_file ():
74
76
with patch ("builtins.open" , mock_open ()) as f :
75
77
f .side_effect = FileNotFoundError ()
76
- try :
77
- TypeConfiguration .get_hook_configuration ()
78
- except FileNotFoundError :
79
- pass
78
+ assert TypeConfiguration .get_hook_configuration () is None
You can’t perform that action at this time.
0 commit comments