From 353f812393157b174e50eb041071cfc1d60bcfc5 Mon Sep 17 00:00:00 2001 From: Artyom Date: Thu, 23 Aug 2018 11:49:52 +0300 Subject: [PATCH] update blank as html --- onelya_sdk/railway/reservation/__init__.py | 5 +++-- setup.py | 2 +- tests/data/Railway/Reservation/BlankAsHtml.in.json | 3 ++- tests/test_api.py | 2 +- 4 files changed, 7 insertions(+), 5 deletions(-) diff --git a/onelya_sdk/railway/reservation/__init__.py b/onelya_sdk/railway/reservation/__init__.py index c8699fc..1ae9de1 100644 --- a/onelya_sdk/railway/reservation/__init__.py +++ b/onelya_sdk/railway/reservation/__init__.py @@ -106,8 +106,9 @@ def meal_option(self, order_item_id: int, meal_option_code: str, order_item_blan order_item_blank_id=order_item_blank_id) return MealOption(response) - def blank_as_html(self, order_item_id: int): - response = self.request_wrapper.make_request(BLANK_AS_HTML_METHOD, order_item_id=order_item_id) + def blank_as_html(self, order_item_id: int, order_item_ids: 'list of int'=None): + response = self.request_wrapper.make_request(BLANK_AS_HTML_METHOD, order_item_id=order_item_id, + order_item_ids=order_item_ids) return BlankAsHtml(response) diff --git a/setup.py b/setup.py index 03fc3d0..eb77175 100644 --- a/setup.py +++ b/setup.py @@ -1,6 +1,6 @@ from setuptools import setup, find_packages -__version__ = '1.3.4' +__version__ = '1.3.5' setup( version=__version__, diff --git a/tests/data/Railway/Reservation/BlankAsHtml.in.json b/tests/data/Railway/Reservation/BlankAsHtml.in.json index 0f4733b..3a07717 100644 --- a/tests/data/Railway/Reservation/BlankAsHtml.in.json +++ b/tests/data/Railway/Reservation/BlankAsHtml.in.json @@ -1,3 +1,4 @@ { - "OrderItemId": 1 + "OrderItemId": 0, + "OrderItemIds": [1] } diff --git a/tests/test_api.py b/tests/test_api.py index c89855f..b9b5037 100644 --- a/tests/test_api.py +++ b/tests/test_api.py @@ -261,7 +261,7 @@ def test_reservation_meal_option(self): @mock.patch('requests.Session', MockHTMLSession) def test_reservation_blank_as_html(self): api = API(self.username, self.password, self.pos) - blank_as_html = api.railway_reservation.blank_as_html(1) + blank_as_html = api.railway_reservation.blank_as_html(0, [1]) input_data = json.loads(open('tests/data/Railway/Reservation/BlankAsHtml.in.json', 'r', encoding='utf8').read()) html_file = open(HTML_PATH, 'r').read()