Skip to content

Commit 660cb47

Browse files
committed
set fedex logging to info, fix ship test
1 parent 9bb5ca1 commit 660cb47

9 files changed

+16
-3
lines changed

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_fedex_config()
1616

1717
logging.getLogger('suds').setLevel(logging.ERROR)
18+
logging.getLogger('fedex').setLevel(logging.INFO)
1819

1920

2021
@unittest.skipIf(not CONFIG_OBJ.account_number, "No credentials provided.")

tests/test_availability_commitment_service.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
CONFIG_OBJ = get_fedex_config()
1616

1717
logging.getLogger('suds').setLevel(logging.ERROR)
18+
logging.getLogger('fedex').setLevel(logging.INFO)
1819

1920

2021
@unittest.skipIf(not CONFIG_OBJ.account_number, "No credentials provided.")
@@ -32,8 +33,8 @@ def test_track(self):
3233
avc_request.Origin.PostalCode = 'M5V 3A4'
3334
avc_request.Origin.CountryCode = 'CA'
3435

35-
avc_request.Origin.PostalCode = '27577' # 29631
36-
avc_request.Origin.CountryCode = 'US'
36+
avc_request.Destination.PostalCode = '27577' # 29631
37+
avc_request.Destination.CountryCode = 'US'
3738

3839
avc_request.send_request()
3940
assert avc_request.response

tests/test_country_service.py

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

1717
logging.getLogger('suds').setLevel(logging.ERROR)
18+
logging.getLogger('fedex').setLevel(logging.INFO)
1819

1920

2021
@unittest.skipIf(not CONFIG_OBJ.account_number, "No credentials provided.")

tests/test_location_service.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616

1717
logging.getLogger('suds').setLevel(logging.ERROR)
1818

19+
1920
@unittest.skipIf(not CONFIG_OBJ.account_number, "No credentials provided.")
2021
class SearchLocationServiceTests(unittest.TestCase):
2122
"""
@@ -47,6 +48,7 @@ def test_location_address_search(self):
4748
location_request.Address.PostalCode = '38119'
4849
location_request.Address.CountryCode = 'US'
4950

51+
5052
if __name__ == "__main__":
5153
logging.basicConfig(stream=sys.stdout, level=logging.INFO)
5254
unittest.main()

tests/test_package_movement_service.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
CONFIG_OBJ = get_fedex_config()
1919

2020
logging.getLogger('suds').setLevel(logging.ERROR)
21+
logging.getLogger('fedex').setLevel(logging.INFO)
2122

2223

2324
@unittest.skipIf(not CONFIG_OBJ.account_number, "No credentials provided.")

tests/test_rate_service.py

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

1717
logging.getLogger('suds').setLevel(logging.ERROR)
18+
logging.getLogger('fedex').setLevel(logging.INFO)
1819

1920

2021
@unittest.skipIf(not CONFIG_OBJ.account_number, "No credentials provided.")

tests/test_ship_service.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
CONFIG_OBJ = get_fedex_config()
1717

1818
logging.getLogger('suds').setLevel(logging.ERROR)
19+
logging.getLogger('fedex').setLevel(logging.INFO)
1920

2021

2122
@unittest.skipIf(not CONFIG_OBJ.account_number, "No credentials provided.")
@@ -75,7 +76,7 @@ def test_create_delete_shipment(self):
7576
shipment.send_request()
7677

7778
assert shipment.response
78-
assert shipment.response.HighestSeverity == 'SUCCESS'
79+
assert shipment.response.HighestSeverity in ['SUCCESS', 'WARNING']
7980
track_id = shipment.response.CompletedShipmentDetail.CompletedPackageDetails[0].TrackingIds[0].TrackingNumber
8081
assert track_id
8182

tests/test_tools.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,9 @@
1212
import fedex.services.ship_service as service # Any request object will do.
1313
import fedex.tools.conversion
1414

15+
logging.getLogger('suds').setLevel(logging.ERROR)
16+
logging.getLogger('fedex').setLevel(logging.INFO)
17+
1518

1619
class FedexToolsTests(unittest.TestCase):
1720
"""
@@ -40,6 +43,7 @@ def test_conversion_tools(self):
4043
dict_obj = fedex.tools.conversion.sobject_to_json(obj)
4144
assert dict_obj, "Expecting a JSON string object."
4245

46+
4347
if __name__ == "__main__":
4448
logging.basicConfig(stream=sys.stdout, level=logging.INFO)
4549
unittest.main()

tests/test_track_service.py

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

1717
logging.getLogger('suds').setLevel(logging.ERROR)
18+
logging.getLogger('fedex').setLevel(logging.INFO)
1819

1920

2021
@unittest.skipIf(not CONFIG_OBJ.account_number, "No credentials provided.")

0 commit comments

Comments
 (0)