File tree Expand file tree Collapse file tree 4 files changed +54
-0
lines changed
Expand file tree Collapse file tree 4 files changed +54
-0
lines changed Original file line number Diff line number Diff line change 1+ LICENSE.txt
2+ recursive-include examples *.txt *.py
3+ recursive-include docs *
Original file line number Diff line number Diff line change 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 )
Original file line number Diff line number Diff line change 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 )
You can’t perform that action at this time.
0 commit comments