tests: Make consistent rate test a little more robust.
This commit is contained in:
parent
c9382a2604
commit
77393ee80f
1 changed files with 3 additions and 3 deletions
|
@ -252,10 +252,10 @@ def test_rate_consistent_as_cost_and_price(alternate_responder, any_date, output
|
|||
config = build_config(date=any_date, **config_kwargs)
|
||||
with io.StringIO() as output:
|
||||
lines = lines_from_run(config, output)
|
||||
match = re.search(r'\{=?\d+\.\d+ USD\}', next(lines, "<EOF>"))
|
||||
assert match is not None
|
||||
amount, _, _ = next(lines).partition('@')
|
||||
expected = amount.replace('\n', ' ')
|
||||
future_date = any_date.replace(year=any_date.year + 1)
|
||||
config = build_config(date=future_date, from_date=any_date, **config_kwargs)
|
||||
with io.StringIO() as output:
|
||||
lines = lines_from_run(config, output)
|
||||
assert match.group(0) in next(lines, "<EOF>")
|
||||
assert next(lines, "<EOF>").startswith(expected)
|
||||
|
|
Loading…
Reference in a new issue