예제 #1
0
 def test_matches_barcode(self):
     usps = package.USPSIMpb('420221539101026837331000039521')
     assert usps.matches_barcode == True
예제 #2
0
 def test_not_matches_barcode(self):
     # Begins with '430' instead of '420'
     usps = package.USPSIMpb('430221539101026837331000039521')
     assert usps.matches_barcode == False
예제 #3
0
 def test_is_valid_nine_digit_zip(self):
     usps = package.USPSIMpb('4209731792009205592767756015842558')
     assert usps.is_valid == True
예제 #4
0
 def test_valid_checksum_zero_checksum(self):
     usps = package.USPSIMpb('9212391234567812345670')
     assert usps.valid_checksum == True
예제 #5
0
 def test_is_valid_no_zip(self):
     usps = package.USPSIMpb('9212391234567812345670')
     assert usps.shipper == 'USPS'
예제 #6
0
 def test_is_valid(self):
     usps = package.USPSIMpb('420221539101026837331000039521')
     assert usps.is_valid == True
예제 #7
0
 def test_shipper(self):
     usps = package.USPSIMpb('420221539101026837331000039521')
     assert usps.shipper == 'USPS'
예제 #8
0
 def test_tracking_number(self):
     usps = package.USPSIMpb('420221539101026837331000039521')
     assert usps.tracking_number == '9101026837331000039521'
예제 #9
0
 def test_barcode_spaces(self):
     usps = package.USPSIMpb('420 22153 9101026837331000039521')
     assert usps.barcode == '420221539101026837331000039521'