def test_webinspect_api_upload_policy_delete_existing_policy_success(upload_policy_mock, delete_policy_mock, get_policy_mock, ntpath_mock): # Given # There is existing policy by this name so deletion webinspect_api_helper_object = WebInspectAPIHelper(silent=True, webinspect_setting_overrides=MagicMock()) expected_response = WebInspectResponse(response_code=200, success=True, data={'test_data': 'test_data', 'uniqueId': "12345"}) # there is an existing policy on the server get_policy_mock.return_value = expected_response # When webinspect_api_helper_object.upload_policy() # Expect assert get_policy_mock.call_count == 1 assert delete_policy_mock.call_count == 1 assert upload_policy_mock.call_count == 1
def download_proxy_setting(self, instance_id=None): return WebInspectResponse(success=self.success, message=self.message, data=self.data)
def upload_webmacro_proxy(self, id=None, macro_file_path=None): return WebInspectResponse(success=self.success, message=self.message, data=self.data)
def get_proxy_information(self, instance_id=None): return WebInspectResponse(success=self.success, message=self.message, data=self.data)
def list_proxies(self): return WebInspectResponse(success=self.success, message=self.message, data=[self.data])
def delete_proxy(self, instance_id=None): return WebInspectResponse(success=self.success, message=self.message, data=self.data)
def start_proxy(self, id=None, port=None, address=None): return WebInspectResponse(success=self.success, message=self.message, data=self.data)
def cert_proxy(self): return WebInspectResponse(success=self.success, message=self.message, data=self.data)