test: fix hypothesis tests (#34416)

This commit is contained in:
Ankush Menat 2023-03-13 15:16:30 +05:30 committed by GitHub
parent 5bf6fb43a9
commit b8a61be080
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -132,7 +132,7 @@ class TestFIFOValuation(unittest.TestCase):
total_qty = 0
for qty, rate in stock_queue:
if qty == 0:
if round_off_if_near_zero(qty) == 0:
continue
if qty > 0:
self.queue.add_stock(qty, rate)
@ -154,7 +154,7 @@ class TestFIFOValuation(unittest.TestCase):
for qty, rate in stock_queue:
# don't allow negative stock
if qty == 0 or total_qty + qty < 0 or abs(qty) < 0.1:
if round_off_if_near_zero(qty) == 0 or total_qty + qty < 0 or abs(qty) < 0.1:
continue
if qty > 0:
self.queue.add_stock(qty, rate)
@ -179,7 +179,7 @@ class TestFIFOValuation(unittest.TestCase):
for qty, rate in stock_queue:
# don't allow negative stock
if qty == 0 or total_qty + qty < 0 or abs(qty) < 0.1:
if round_off_if_near_zero(qty) == 0 or total_qty + qty < 0 or abs(qty) < 0.1:
continue
if qty > 0:
self.queue.add_stock(qty, rate)
@ -282,7 +282,7 @@ class TestLIFOValuation(unittest.TestCase):
total_qty = 0
for qty, rate in stock_stack:
if qty == 0:
if round_off_if_near_zero(qty) == 0:
continue
if qty > 0:
self.stack.add_stock(qty, rate)
@ -304,7 +304,7 @@ class TestLIFOValuation(unittest.TestCase):
for qty, rate in stock_stack:
# don't allow negative stock
if qty == 0 or total_qty + qty < 0 or abs(qty) < 0.1:
if round_off_if_near_zero(qty) == 0 or total_qty + qty < 0 or abs(qty) < 0.1:
continue
if qty > 0:
self.stack.add_stock(qty, rate)