Skip to content

Commit

Permalink
Merge branch 'master' into develop
Browse files Browse the repository at this point in the history
  • Loading branch information
Bobspadger committed Apr 6, 2018
2 parents ea3325b + 32dad4a commit d924661
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 0 deletions.
2 changes: 2 additions & 0 deletions royal_mail_rest_api/tools.py
Original file line number Diff line number Diff line change
Expand Up @@ -262,11 +262,13 @@ def add_service_format(self, format=None):
def add_service_type(self, service_type=None):
if service_type is None:
raise(ValueError('no service type selected'))

if service_type not in self.service_types:
raise(KeyError('Invalid service type'))
self.service_type = self.service_types[service_type]



def add_service_offering(self, service_offering=None):
if service_offering is None:
raise(ValueError('No service type selected'))
Expand Down
2 changes: 2 additions & 0 deletions setup.cfg
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
[bumpversion]

current_version = 0.0.5

commit = True
tag = True

Expand Down
2 changes: 2 additions & 0 deletions tests/test_royal_mail_rest_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import datetime
from royal_mail_rest_api.tools import RoyalMailBody


def test_add_services():
body = RoyalMailBody('delivery')
with pytest.raises(ValueError):
Expand Down Expand Up @@ -42,3 +43,4 @@ def test_add_ship_date():
# Test we get date out in format YYYY-mm-dd
body.add_ship_date(datetime.datetime.today())
assert body.shipping_date == datetime.datetime.strftime(datetime.datetime.today(), '%Y-%m-%d')

0 comments on commit d924661

Please sign in to comment.