Skip to content

Commit e6a5137

Browse files
author
Greg Taylor
committed
Tweaking props.
1 parent 8625851 commit e6a5137

File tree

4 files changed

+54
-0
lines changed

4 files changed

+54
-0
lines changed

MANIFEST.in

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
LICENSE.txt
2+
recursive-include examples *.txt *.py
3+
recursive-include docs *

test/__init__.py

Whitespace-only changes.

test/common.py

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
"""
2+
This module contains common definitions and functions used within the
3+
test suite.
4+
"""
5+
from fedex.config import FedexConfig
6+
7+
def get_test_config():
8+
"""
9+
Returns a basic FedexConfig to test with.
10+
"""
11+
"""
12+
# Production server
13+
return FedexConfig(key='xxxxxxxxxxxxxxxxx',
14+
password='xxxxxxxxxxxxxxxxxxxxxxxxx',
15+
account_number='xxxxxxxxx',
16+
meter_number='xxxxxxxxxx')
17+
"""
18+
# Test server
19+
return FedexConfig(key='ZyNQQFdcxUATOx9L',
20+
password='GtngmKzs4Dk4RYmrlAjrLykwi',
21+
account_number='510087780',
22+
meter_number='118501898',
23+
use_test_server=True)

test/t_track_service.py

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
"""
2+
Test module for the Fedex ShipService WSDL.
3+
"""
4+
import unittest
5+
from fedex.services.track_service import FedexTrackRequest
6+
import common
7+
8+
# Common global config object for testing.
9+
CONFIG_OBJ = common.get_test_config()
10+
11+
class TrackServiceTests(unittest.TestCase):
12+
"""
13+
These tests verify that the shipping service WSDL is in good shape.
14+
"""
15+
def test_track(self):
16+
"""
17+
Test shipment tracking. Query for a tracking number and make sure the
18+
first (and hopefully only) result matches up.
19+
"""
20+
track = FedexTrackRequest(CONFIG_OBJ)
21+
track.TrackPackageIdentifier.Type = 'TRACKING_NUMBER_OR_DOORTAG'
22+
track.TrackPackageIdentifier.Value = '798114182456'
23+
track.send_request()
24+
25+
for match in track.response.TrackDetails:
26+
# This should be the same tracking number on the response that we
27+
# asked for in the request.
28+
self.assertEqual(match.TrackingNumber, tracking_num)

0 commit comments

Comments
 (0)