Skip to content

Just check mass returned is > 0 for shipping estimates since test val… #69

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Aug 3, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 14 additions & 14 deletions test/test_estimates_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@ def test_create_air_shipping_estimate_airport_iatas(self):
self.assertEqual(estimate.data.order, None)
self.assertEqual(estimate.data.type, "shipping_air")
self.assertGreater(
estimate.data.mass_g, 10_000
estimate.data.mass_g, 0
) # not setting an exact value since the mock values returned are randomized

def test_create_air_shipping_estimate_create_order(self):
Expand All @@ -223,7 +223,7 @@ def test_create_air_shipping_estimate_create_order(self):
self.assertGreater(estimate.data.order.amount, 2_000)
self.assertEqual(estimate.data.type, "shipping_air")
self.assertGreater(
estimate.data.mass_g, 10_000
estimate.data.mass_g, 0
) # not setting an exact value since the mock values returned are randomized

def test_create_rail_shipping_estimate_addresses(self):
Expand All @@ -241,7 +241,7 @@ def test_create_rail_shipping_estimate_addresses(self):
self.assertEqual(estimate.data.order, None)
self.assertEqual(estimate.data.type, "shipping_rail")
self.assertGreater(
estimate.data.mass_g, 300
estimate.data.mass_g, 0
) # not setting an exact value since the mock values returned are randomized

def test_create_rail_shipping_estimate_locodes(self):
Expand All @@ -255,7 +255,7 @@ def test_create_rail_shipping_estimate_locodes(self):
self.assertEqual(estimate.data.order, None)
self.assertEqual(estimate.data.type, "shipping_rail")
self.assertGreater(
estimate.data.mass_g, 800
estimate.data.mass_g, 0
) # not setting an exact value since the mock values returned are randomized

def test_create_rail_shipping_estimate_create_order(self):
Expand All @@ -269,10 +269,10 @@ def test_create_rail_shipping_estimate_create_order(self):
freight_mass_g=19_217,
origin_locode="USSEA",
)
self.assertGreater(estimate.data.order.amount, 900)
self.assertGreater(estimate.data.order.amount, 0)
self.assertEqual(estimate.data.type, "shipping_rail")
self.assertGreater(
estimate.data.mass_g, 800
estimate.data.mass_g, 0
) # not setting an exact value since the mock values returned are randomized

def test_create_road_shipping_estimate_addresses(self):
Expand All @@ -290,7 +290,7 @@ def test_create_road_shipping_estimate_addresses(self):
self.assertEqual(estimate.data.order, None)
self.assertEqual(estimate.data.type, "shipping_road")
self.assertGreater(
estimate.data.mass_g, 600
estimate.data.mass_g, 0
) # not setting an exact value since the mock values returned are randomized

def test_create_road_shipping_estimate_locodes(self):
Expand All @@ -304,7 +304,7 @@ def test_create_road_shipping_estimate_locodes(self):
self.assertEqual(estimate.data.order, None)
self.assertEqual(estimate.data.type, "shipping_road")
self.assertGreater(
estimate.data.mass_g, 1_000
estimate.data.mass_g, 0
) # not setting an exact value since the mock values returned are randomized

def test_create_road_shipping_estimate_create_order(self):
Expand All @@ -318,10 +318,10 @@ def test_create_road_shipping_estimate_create_order(self):
freight_mass_g=21_933,
origin_locode="USSEA",
)
self.assertGreater(estimate.data.order.amount, 1_000)
self.assertGreater(estimate.data.order.amount, 0)
self.assertEqual(estimate.data.type, "shipping_road")
self.assertGreater(
estimate.data.mass_g, 800
estimate.data.mass_g, 0
) # not setting an exact value since the mock values returned are randomized

def test_create_sea_shipping_estimate_addresses(self):
Expand All @@ -339,7 +339,7 @@ def test_create_sea_shipping_estimate_addresses(self):
self.assertEqual(estimate.data.order, None)
self.assertEqual(estimate.data.type, "shipping_sea")
self.assertGreater(
estimate.data.mass_g, 600
estimate.data.mass_g, 0
) # not setting an exact value since the mock values returned are randomized

def test_create_sea_shipping_estimate_locodes(self):
Expand All @@ -353,7 +353,7 @@ def test_create_sea_shipping_estimate_locodes(self):
self.assertEqual(estimate.data.order, None)
self.assertEqual(estimate.data.type, "shipping_sea")
self.assertGreater(
estimate.data.mass_g, 1_000
estimate.data.mass_g, 0
) # not setting an exact value since the mock values returned are randomized

def test_create_sea_shipping_estimate_create_order(self):
Expand All @@ -367,10 +367,10 @@ def test_create_sea_shipping_estimate_create_order(self):
freight_mass_g=22_210,
origin_locode="USSEA",
)
self.assertGreater(estimate.data.order.amount, 1_000)
self.assertGreater(estimate.data.order.amount, 0)
self.assertEqual(estimate.data.type, "shipping_sea")
self.assertGreater(
estimate.data.mass_g, 800
estimate.data.mass_g, 0
) # not setting an exact value since the mock values returned are randomized


Expand Down