Skip to content

Commit

Permalink
Merge 83072de into 65c5445
Browse files Browse the repository at this point in the history
  • Loading branch information
liampauling committed Nov 12, 2018
2 parents 65c5445 + 83072de commit a456c91
Show file tree
Hide file tree
Showing 6 changed files with 29 additions and 3 deletions.
15 changes: 15 additions & 0 deletions HISTORY.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,21 @@
Release History
---------------

1.8.1 (2018-10-12)
+++++++++++++++++++

**Improvements**

- Str representation added to PriceSize object.

**Bug Fixes**

- RaceCard resource bug fix.

**Dependencies**

- Upgrade to requests 2.20.1 (security fix)

1.8.0 (2018-10-08)
+++++++++++++++++++

Expand Down
2 changes: 1 addition & 1 deletion betfairlightweight/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
from . import filters

__title__ = 'betfairlightweight'
__version__ = '1.8.0'
__version__ = '1.8.1'
__author__ = 'Liam Pauling'

# Set default logging handler to avoid "No handler found" warnings.
Expand Down
3 changes: 3 additions & 0 deletions betfairlightweight/resources/bettingresources.py
Original file line number Diff line number Diff line change
Expand Up @@ -292,6 +292,9 @@ def __init__(self, price, size):
self.price = price
self.size = size

def __str__(self):
return 'Price: %s Size: %s' % (self.price, self.size)


class RunnerBookSP(object):
"""
Expand Down
3 changes: 2 additions & 1 deletion betfairlightweight/resources/racecardresources.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,8 @@ class Course(object):
:type timezone: unicode
"""

def __init__(self, country, countryCode, courseId, name, surfaceType, timeformCourseCode, timezone, courseType=None):
def __init__(self, country, countryCode, courseId, name, surfaceType=None, timeformCourseCode=None, timezone=None,
courseType=None):
self.country = country
self.country_code = countryCode
self.course_id = courseId
Expand Down
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
setuptools==39.2.0
requests==2.19.1
requests==2.20.1
ciso8601==2.0.1
ujson==1.35
7 changes: 7 additions & 0 deletions tests/unit/test_bettingresources.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
LimitOrder,
LimitOnCloseOrder,
MarketOnCloseOrder,
PriceSize,
)
from tests.unit.tools import create_mock_json

Expand Down Expand Up @@ -231,6 +232,12 @@ def test_market_book(self):
# # print(resource_runner.matches)
# # todo complete

def test_price_size(self):
price_size = PriceSize(**{'price': 1.01, 'size': 2048})
self.assertEqual(price_size.price, 1.01)
self.assertEqual(price_size.size, 2048)
self.assertEqual(str(price_size), 'Price: 1.01 Size: 2048')

def test_current_orders(self):
mock_response = create_mock_json('tests/resources/list_current_orders.json')
current_orders = mock_response.json().get('result')
Expand Down

0 comments on commit a456c91

Please sign in to comment.