Skip to content

Commit 2e4763d

Browse files
committed
Merge pull request #63 from gtaylor/travis
Travis
2 parents 1a4867d + 9276f42 commit 2e4763d

15 files changed

+70
-8
lines changed

.travis.yml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
language: python
2+
sudo: false
3+
python:
4+
- "2.7"
5+
- "3.5"
6+
7+
# command to install dependencies
8+
install:
9+
- pip install .
10+
- pip install -r requirements.txt
11+
12+
# command to run tests
13+
script: nosetests

CHANGES.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@ Change Log
88
* Added [Validation]AvailabilityAndCommitmentService_v4.wsdl for AVC service. (radzhome)
99
* Added examples and unit tests for AVC service.
1010
* Refactored examples and documentation. (radzhome)
11+
* A quick PEP8 pass using pycharm on most of the codebase (radzhome)
12+
* Add travis yml (radzhome)
1113

1214

1315
2.0.0

fedex/config.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,5 +70,5 @@ def __init__(self, key, password, account_number=None, meter_number=None, freigh
7070
if wsdl_path is None:
7171
self.wsdl_path = os.path.join(os.path.dirname(os.path.abspath(__file__)),
7272
'wsdl')
73-
else:
73+
else: # pragma: no cover
7474
self.wsdl_path = wsdl_path

fedex/services/package_movement.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ def _check_response_for_request_errors(self):
5757
this WSDL.
5858
"""
5959
if self.response.HighestSeverity == "ERROR":
60-
for notification in self.response.Notifications:
60+
for notification in self.response.Notifications: # pragma: no cover
6161
if notification.Severity == "ERROR":
6262
if "Postal Code Not Found" in notification.Message:
6363
raise FedexPostalCodeNotFound(notification.Code,

fedex/services/ship_service.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -210,6 +210,6 @@ def _assemble_and_send_request(self):
210210
ClientDetail=self.ClientDetail,
211211
TransactionDetail=self.TransactionDetail,
212212
Version=self.VersionId,
213-
ShipTimestamp=datetime.now(),
213+
ShipTimestamp=datetime.datetime.now(),
214214
TrackingId=self.TrackingId,
215215
DeletionControl=self.DeletionControlType)

fedex/services/track_service.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ def _check_response_for_request_errors(self):
8282
Checks the response to see if there were any errors specific to
8383
this WSDL.
8484
"""
85-
if self.response.HighestSeverity == "ERROR":
85+
if self.response.HighestSeverity == "ERROR": # pragma: no cover
8686
for notification in self.response.Notifications:
8787
if notification.Severity == "ERROR":
8888
if "Invalid tracking number" in notification.Message:

requirements.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
suds-jurko

tests/common.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ def get_test_config():
1010
Returns a basic FedexConfig to test with.
1111
"""
1212
# Test server (Enter your credentials here)
13-
return FedexConfig(key='xxxxxxxxxxxxxxxxx',
14-
password='xxxxxxxxxxxxxxxxxxxxxxxxx',
15-
account_number='xxxxxxxxx',
16-
meter_number='xxxxxxxxxx',
13+
return FedexConfig(key='',
14+
password='',
15+
account_number='',
16+
meter_number='',
1717
use_test_server=True)

tests/test_address_validation_service.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
CONFIG_OBJ = get_test_config()
1616

1717

18+
@unittest.skipIf(not CONFIG_OBJ.account_number, "No credentials provided.")
1819
class AddressValidationServiceTests(unittest.TestCase):
1920
"""
2021
These tests verify that the address validation service WSDL is in good shape.

tests/test_availability_commitment_service.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
CONFIG_OBJ = get_test_config()
1616

1717

18+
@unittest.skipIf(not CONFIG_OBJ.account_number, "No credentials provided.")
1819
class AvailabilityCommitmentServiceTests(unittest.TestCase):
1920
"""
2021
These tests verify that the shipping service WSDL is in good shape.

0 commit comments

Comments
 (0)