def test_create_report_schedule(): res = Reports().create_report_schedule( reportType='GET_FLAT_FILE_OPEN_LISTINGS_DATA', period=Schedules.HOURS_8.value) print(res) assert res.errors is None assert 'reportScheduleId' in res.payload
def test_create_report_schedule(): res = Reports().create_report_schedule(reportType='FEE_DISCOUNTS_REPORT', period=Schedules.MINUTES_5.value, nextReportCreationTime="2019-12-10T20:11:24.000Z", marketplaceIds=["A1PA6795UKMFR9", "ATVPDKIKX0DER"]) assert res.errors is None assert 'reportScheduleId' in res.payload
def test_create_report_expect_400(): try: res = Reports().create_report( reportType="BAD_FEE_DISCOUNTS_REPORT", dataStartTime="2019-12-10T20:11:24.000Z", marketplaceIds=["A1PA6795UKMFR9", "ATVPDKIKX0DER"]) except SellingApiBadRequestException as br: assert br.code == 400
def test_get_reports_2(): report_types = ["FEE_DISCOUNTS_REPORT", "GET_AFN_INVENTORY_DATA"] processing_status = [ ProcessingStatus.IN_QUEUE, ProcessingStatus.IN_PROGRESS ] res = Reports().get_reports(reportTypes=report_types, processingStatuses=processing_status) assert res.errors is None
def test_create_report_expect_500(): try: res = Reports().create_report( reportType="BAD_FEE_DISCasdafsdsfsdfsdOUNTS_REPORT", dataStartTime="2019-12-10T20:11:24.000Z", marketplaceIds=["A1PA6asfd795UKMFR9", "ATVPDKIKX0DER"]) except SellingApiServerException as br: assert br.code == 500
def request_report(self, report_type: str, data_start_time: str, data_end_time: str) -> any: response = Reports(credentials=self.credentials, marketplace=self.marketplace).create_report( reportType=report_type, dataStartTime=data_start_time, dataEndTime=data_end_time) return response.payload
def test_create_report(): res = Reports().create_report( reportType='GET_MERCHANT_LISTINGS_ALL_DATA', dataStartTime='2019-12-10T20:11:24.000Z', marketplaceIds=[ "A1PA6795UKMFR9", "ATVPDKIKX0DER" ]) assert res.payload.get('reportId') == 'ID323'
def test_get_reports_4(): report_types = [ ReportType.FEE_DISCOUNTS_REPORT, ReportType.GET_AFN_INVENTORY_DATA ] processing_status = [ ProcessingStatus.IN_QUEUE, ProcessingStatus.IN_PROGRESS ] res = Reports().get_reports( reportTypes=report_types, processingStatuses=processing_status, marketplaceIds=[Marketplaces.US, Marketplaces.US.marketplace_id]) assert res.errors is None
def test_get_report_document_w_decrypt(): res = Reports().get_report_document('5', decrypt=True, file=open('output.tsv', 'w+')) print(res) assert 'document' in res.payload
def test_get_report(): res = Reports().get_report('ID323') assert res.payload.get('reportId') == 'ReportId1' assert res.payload.get('reportType') == 'FEE_DISCOUNTS_REPORT'
def test_get_report_document_n_decrypt(): res = Reports().get_report_document('0356cf79-b8b0-4226-b4b9-0ee058ea5760', decrypt=False) assert res.errors is None assert 'document' not in res.payload
def test_create_report(): print(Reports().create_report(reportType='GET_FBA_MYI_ALL_INVENTORY_DATA'))
def test_create_report(): print( Reports(marketplace=Marketplaces.DE).create_report( reportType='GET_MERCHANT_LISTINGS_ALL_DATA'))
def test_delete_schedule_by_id(): res = Reports().delete_report_schedule('5000d4018615') print(res) assert res.errors is None
def test_get_schedule_by_id_existing_schedule(): res = Reports().get_report_schedule('5000401d8615') print(res) assert res.errors is None
def get_report(self, report_id: str): response = Reports( credentials=self.credentials, marketplace=Marketplaces.IN).get_report(report_id=report_id) return response.payload
def test_get_report(): print(Reports(marketplace=Marketplaces.DE).get_report('50632018648'))
def test_delete_schedule_by_id(): res = Reports().delete_report_schedule('ID') assert res.errors is None
def test_get_report(): print(Reports().get_report('600333018624'))
def get_report_document(self, report_document_id: str): response = Reports(credentials=self.credentials, marketplace=Marketplaces.IN).get_report_document( report_document_id, decrypt=True) return response.payload
def test_get_schedule_by_id(): res = Reports().get_report_schedule('ID323') assert res.errors is None assert 'period' in res.payload assert res.payload.get('reportType') == 'FEE_DISCOUNTS_REPORT'
def test_get_report_document_n_decrypt(): res = Reports().get_report_document('as', decrypt=False) print(res) assert 'document' not in res.payload