@@ -103,6 +103,7 @@ def test_client_system_caches_runtime_list(self):
103
103
result = ce .runtime_caches
104
104
self .assertDictEqual (result , mocked_response )
105
105
106
+ # RSConnectExecutor.delete_runtime_cache() dry run returns expected request
106
107
# RSConnectExecutor.delete_runtime_cache() dry run prints expected messages
107
108
@httpretty .activate (verbose = True , allow_net_connect = False )
108
109
def test_executor_delete_runtime_cache_dry_run (self ):
@@ -119,13 +120,16 @@ def test_executor_delete_runtime_cache_dry_run(self):
119
120
120
121
captured_output = io .StringIO ()
121
122
sys .stdout = captured_output
122
- result = ce .delete_runtime_cache (language = "Python" , version = "1.2.3" , image_name = "teapot" , dry_run = True )
123
+ ce .delete_runtime_cache (language = "Python" , version = "1.2.3" , image_name = "teapot" , dry_run = True )
123
124
sys .stdout = sys .__stdout__
124
125
125
126
# Print expectations
126
127
output_lines = captured_output .getvalue ().splitlines ()
127
128
self .assertEqual (output_lines [0 ], "Dry run finished" )
128
129
130
+ # Result expectations
131
+ self .assertDictEqual (mocked_output , ce .state ["result" ])
132
+
129
133
# RSConnectExecutor.delete_runtime_cache() wet run returns expected request
130
134
# RSConnectExecutor.delete_runtime_cache() wet run prints expected messages
131
135
@httpretty .activate (verbose = True , allow_net_connect = False )
@@ -165,11 +169,16 @@ def test_executor_delete_runtime_cache_wet_run(self):
165
169
166
170
captured_output = io .StringIO ()
167
171
sys .stdout = captured_output
168
- result = ce .delete_runtime_cache (language = "Python" , version = "1.2.3" , image_name = "teapot" , dry_run = False )
172
+ ce .delete_runtime_cache (language = "Python" , version = "1.2.3" , image_name = "teapot" , dry_run = False )
169
173
sys .stdout = sys .__stdout__
170
174
171
175
# Print expectations
172
- # TODO: Figure out how to capture the output of `connect_logger` and make assertions.
176
+ # TODO: *We* don't print anything here anymore. Unsure how to capture log messages from Connect.
177
+ # output_lines = captured_output.getvalue().splitlines()
178
+ # self.assertEqual(output_lines[0], "Cache deletion finished")
179
+
180
+ # Result expectations
181
+ self .assertDictEqual (mocked_task_status , ce .state ["task_status" ])
173
182
174
183
# RSConnectExecutor.delete_runtime_cache() raises the correct error
175
184
@httpretty .activate (verbose = True , allow_net_connect = False )
0 commit comments