Skip to content

Commit

Permalink
Fix ZLT corner case
Browse files Browse the repository at this point in the history
  • Loading branch information
tbarbette committed Nov 19, 2024
1 parent 6fda702 commit 0a30d85
Showing 1 changed file with 13 additions and 10 deletions.
23 changes: 13 additions & 10 deletions integration/test_unittest.py
Original file line number Diff line number Diff line change
Expand Up @@ -204,23 +204,24 @@ 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
results[Run({'RATE' : 10})] = {'PPS':[3.0]}
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
Expand All @@ -234,4 +235,6 @@ def _test_allzlt(monotonic):

def test_allzlt():
_test_allzlt(monotonic=True)
_test_allzlt(monotonic=False)
_test_allzlt(monotonic=False)
_test_allzlt(monotonic=True, all=False)
_test_allzlt(monotonic=False, all=False)

0 comments on commit 0a30d85

Please sign in to comment.