test: fix hypothesis tests (#34416)
(cherry picked from commit b8a61be080)
Co-authored-by: Ankush Menat <ankush@frappe.io>
This commit is contained in:
@@ -132,7 +132,7 @@ class TestFIFOValuation(unittest.TestCase):
|
|||||||
total_qty = 0
|
total_qty = 0
|
||||||
|
|
||||||
for qty, rate in stock_queue:
|
for qty, rate in stock_queue:
|
||||||
if qty == 0:
|
if round_off_if_near_zero(qty) == 0:
|
||||||
continue
|
continue
|
||||||
if qty > 0:
|
if qty > 0:
|
||||||
self.queue.add_stock(qty, rate)
|
self.queue.add_stock(qty, rate)
|
||||||
@@ -154,7 +154,7 @@ class TestFIFOValuation(unittest.TestCase):
|
|||||||
|
|
||||||
for qty, rate in stock_queue:
|
for qty, rate in stock_queue:
|
||||||
# don't allow negative stock
|
# 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
|
continue
|
||||||
if qty > 0:
|
if qty > 0:
|
||||||
self.queue.add_stock(qty, rate)
|
self.queue.add_stock(qty, rate)
|
||||||
@@ -179,7 +179,7 @@ class TestFIFOValuation(unittest.TestCase):
|
|||||||
|
|
||||||
for qty, rate in stock_queue:
|
for qty, rate in stock_queue:
|
||||||
# don't allow negative stock
|
# 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
|
continue
|
||||||
if qty > 0:
|
if qty > 0:
|
||||||
self.queue.add_stock(qty, rate)
|
self.queue.add_stock(qty, rate)
|
||||||
@@ -282,7 +282,7 @@ class TestLIFOValuation(unittest.TestCase):
|
|||||||
total_qty = 0
|
total_qty = 0
|
||||||
|
|
||||||
for qty, rate in stock_stack:
|
for qty, rate in stock_stack:
|
||||||
if qty == 0:
|
if round_off_if_near_zero(qty) == 0:
|
||||||
continue
|
continue
|
||||||
if qty > 0:
|
if qty > 0:
|
||||||
self.stack.add_stock(qty, rate)
|
self.stack.add_stock(qty, rate)
|
||||||
@@ -304,7 +304,7 @@ class TestLIFOValuation(unittest.TestCase):
|
|||||||
|
|
||||||
for qty, rate in stock_stack:
|
for qty, rate in stock_stack:
|
||||||
# don't allow negative stock
|
# 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
|
continue
|
||||||
if qty > 0:
|
if qty > 0:
|
||||||
self.stack.add_stock(qty, rate)
|
self.stack.add_stock(qty, rate)
|
||||||
|
|||||||
Reference in New Issue
Block a user