Esempio n. 1
0
    def test_delete_scan_config(self):
        channel = ChannelStub()
        client = websecurityscanner_v1alpha.WebSecurityScannerClient(
            channel=channel)

        # Setup Request
        name = client.scan_config_path('[PROJECT]', '[SCAN_CONFIG]')

        client.delete_scan_config(name)

        assert len(channel.requests) == 1
        expected_request = web_security_scanner_pb2.DeleteScanConfigRequest(
            name=name)
        actual_request = channel.requests[0][1]
        assert expected_request == actual_request
Esempio n. 2
0
    def test_delete_scan_config(self):
        channel = ChannelStub()
        patch = mock.patch("google.api_core.grpc_helpers.create_channel")
        with patch as create_channel:
            create_channel.return_value = channel
            client = websecurityscanner_v1alpha.WebSecurityScannerClient()

        # Setup Request
        name = client.scan_config_path("[PROJECT]", "[SCAN_CONFIG]")

        client.delete_scan_config(name)

        assert len(channel.requests) == 1
        expected_request = web_security_scanner_pb2.DeleteScanConfigRequest(name=name)
        actual_request = channel.requests[0][1]
        assert expected_request == actual_request