我想模拟对GetReportDownloader
和DownloadReportAsStringWithAwql
的调用,但是我不知道该怎么做,因为我已经模拟了部分代码:S
client = self.authenticate()
report_downloader = client.GetReportDownloader(version="v201809")
report = report_downloader.DownloadReportAsStringWithAwql(
report_query,
'CSV',
skip_report_header=True,
skip_column_header=False,
skip_report_summary=True,
include_zero_impressions=False,
)
我已使用模拟程序模拟了呼叫self.authenticate()
:
m2 = mocker.patch('airflow.hooks.google_adwords_hook.GoogleAdwordsHook.authenticate', autospec=True)
是否可以模拟DownloadReportAsStringWithAwql
以返回静态str?