示例#1
0
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
示例#2
0
 def download_proxy_setting(self, instance_id=None):
     return WebInspectResponse(success=self.success, message=self.message, data=self.data)
示例#3
0
 def upload_webmacro_proxy(self, id=None, macro_file_path=None):
     return WebInspectResponse(success=self.success, message=self.message, data=self.data)
示例#4
0
 def get_proxy_information(self, instance_id=None):
     return WebInspectResponse(success=self.success, message=self.message, data=self.data)
示例#5
0
 def list_proxies(self):
     return WebInspectResponse(success=self.success, message=self.message, data=[self.data])
示例#6
0
 def delete_proxy(self, instance_id=None):
     return WebInspectResponse(success=self.success, message=self.message, data=self.data)
示例#7
0
 def start_proxy(self, id=None, port=None, address=None):
     return WebInspectResponse(success=self.success, message=self.message, data=self.data)
示例#8
0
 def cert_proxy(self):
     return WebInspectResponse(success=self.success, message=self.message, data=self.data)