|
17 | 17 | from airbyte_protocol.models import AirbyteStateMessage, FailureType, SyncMode
|
18 | 18 | from source_amazon_seller_partner.streams import ReportProcessingStatus
|
19 | 19 |
|
20 |
| -from .config import CONFIG_END_DATE, CONFIG_START_DATE, MARKETPLACE_ID, NOW, ConfigBuilder |
| 20 | +from .config import CONFIG_END_DATE, CONFIG_START_DATE, MARKETPLACE_ID, NOW, VENDOR_TRAFFIC_REPORT_CONFIG_END_DATE, ConfigBuilder |
21 | 21 | from .request_builder import RequestBuilder
|
22 | 22 | from .response_builder import build_response, response_with_status
|
23 | 23 | from .utils import assert_message_in_log_output, config, find_template, get_stream_by_name, mock_auth, read_output
|
@@ -68,7 +68,8 @@ def _create_report_request(report_name: str) -> RequestBuilder:
|
68 | 68 | A POST request needed to start generating a report on Amazon SP platform.
|
69 | 69 | Performed in ReportsAmazonSPStream._create_report method.
|
70 | 70 | """
|
71 |
| - |
| 71 | + if report_name == "GET_VENDOR_TRAFFIC_REPORT": |
| 72 | + return RequestBuilder.create_vendor_traffic_report_endpoint(report_name) |
72 | 73 | return RequestBuilder.create_report_endpoint(report_name)
|
73 | 74 |
|
74 | 75 |
|
@@ -388,8 +389,11 @@ def test_given_report_status_fatal_when_read_then_exception_raised(
|
388 | 389 |
|
389 | 390 | output = self._read(stream_name, config(), expecting_exception=True)
|
390 | 391 | assert output.errors[-1].trace.error.failure_type == FailureType.config_error
|
| 392 | + config_end_date = CONFIG_END_DATE |
| 393 | + if stream_name == "GET_VENDOR_TRAFFIC_REPORT": |
| 394 | + config_end_date = VENDOR_TRAFFIC_REPORT_CONFIG_END_DATE |
391 | 395 | assert (
|
392 |
| - f"Failed to retrieve the report '{stream_name}' for period {CONFIG_START_DATE}-{CONFIG_END_DATE}. This will be read during the next sync. Error: {{'errorDetails': 'Error in report request: This report type requires the reportPeriod, distributorView, sellingProgram reportOption to be specified. Please review the document for this report type on GitHub, provide a value for this reportOption in your request, and try again.'}}" |
| 396 | + f"Failed to retrieve the report '{stream_name}' for period {CONFIG_START_DATE}-{config_end_date}. This will be read during the next sync. Error: {{'errorDetails': 'Error in report request: This report type requires the reportPeriod, distributorView, sellingProgram reportOption to be specified. Please review the document for this report type on GitHub, provide a value for this reportOption in your request, and try again.'}}" |
393 | 397 | ) in output.errors[-1].trace.error.message
|
394 | 398 |
|
395 | 399 | @pytest.mark.parametrize(
|
|
0 commit comments