From 0a30d859681fef9e5d18c879b975ad06df7e66d5 Mon Sep 17 00:00:00 2001 From: Tom Barbette Date: Tue, 19 Nov 2024 14:47:03 +0100 Subject: [PATCH] Fix ZLT corner case --- integration/test_unittest.py | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/integration/test_unittest.py b/integration/test_unittest.py index 6947746..aa08653 100644 --- a/integration/test_unittest.py +++ b/integration/test_unittest.py @@ -204,10 +204,10 @@ def test_zlt(): logger.error(run) -def _test_allzlt(monotonic): - vlist = {'RATE' : RangeVariable("RATE",1,10,log=False)} +def _test_allzlt(monotonic,all=True): + vlist = {'RATE' : RangeVariable("RATE",1,10,log=False)} #From 1 to 10 included results = OrderedDict() - zlt = ZLTVariableExpander(vlist, results, {}, "RATE", "PPS", 1.01,all=True,monotonic=monotonic) + zlt = ZLTVariableExpander(vlist, results, {}, "RATE", "PPS", 1.01, all=all, monotonic=monotonic) it = iter(zlt) run = next(it) assert run["RATE"] == 10 @@ -215,12 +215,13 @@ def _test_allzlt(monotonic): run = next(it) assert run["RATE"] == 3 results[Run({'RATE' : 3})] = {'PPS':[3]} - run = next(it) - assert run["RATE"] == 2 - results[Run({'RATE' : 2})] = {'PPS':[2]} - run = next(it) - assert run["RATE"] == 1 - results[Run({'RATE' : 1})] = {'PPS':[1]} + if all: + run = next(it) + assert run["RATE"] == 2 + results[Run({'RATE' : 2})] = {'PPS':[2]} + run = next(it) + assert run["RATE"] == 1 + results[Run({'RATE' : 1})] = {'PPS':[1]} if not monotonic: run = next(it) assert run["RATE"] == 4 @@ -234,4 +235,6 @@ def _test_allzlt(monotonic): def test_allzlt(): _test_allzlt(monotonic=True) - _test_allzlt(monotonic=False) \ No newline at end of file + _test_allzlt(monotonic=False) + _test_allzlt(monotonic=True, all=False) + _test_allzlt(monotonic=False, all=False) \ No newline at end of file