def test_update_orders(self): mock_response = create_mock_json('tests/resources/update_orders.json') update_orders = mock_response.json().get('result') resource = resources.UpdateOrders(date_time_sent=self.DATE_TIME_SENT, **update_orders) assert resource._datetime_sent == self.DATE_TIME_SENT assert resource.market_id == update_orders['marketId'] assert resource.status == update_orders['status'] assert resource.customer_ref == update_orders.get('customerRef') assert resource.error_code == update_orders.get('errorCode') assert len(resource.update_instruction_reports) == len(update_orders.get('instructionReports')) for order in update_orders.get('instructionReports'): pass
def test_update_orders(self): mock_response = create_mock_json("tests/resources/update_orders.json") update_orders = mock_response.json().get("result") resource = resources.UpdateOrders(elapsed_time=self.ELAPSED_TIME, **update_orders) assert resource.elapsed_time == self.ELAPSED_TIME assert resource.market_id == update_orders["marketId"] assert resource.status == update_orders["status"] assert resource.customer_ref == update_orders.get("customerRef") assert resource.error_code == update_orders.get("errorCode") assert len(resource.update_instruction_reports) == len( update_orders.get("instructionReports")) for order in update_orders.get("instructionReports"): pass