0 1 0
Brett Smith - 3 months ago 2020-05-20 19:35:27
brettcsmith@brettcsmith.org
tests: Make consistent rate test a little more robust.
1 file changed with 3 insertions and 3 deletions:
↑ Collapse Diff ↑
...
 
@@ -252,10 +252,10 @@ def test_rate_consistent_as_cost_and_price(alternate_responder, any_date, output
252 252
 
    config = build_config(date=any_date, **config_kwargs)
253 253
 
    with io.StringIO() as output:
254 254
 
        lines = lines_from_run(config, output)
255
 
        match = re.search(r'\{=?\d+\.\d+ USD\}', next(lines, "<EOF>"))
256
 
    assert match is not None
255
 
        amount, _, _ = next(lines).partition('@')
256
 
        expected = amount.replace('\n', ' ')
257 257
 
    future_date = any_date.replace(year=any_date.year + 1)
258 258
 
    config = build_config(date=future_date, from_date=any_date, **config_kwargs)
259 259
 
    with io.StringIO() as output:
260 260
 
        lines = lines_from_run(config, output)
261
 
        assert match.group(0) in next(lines, "<EOF>")
261
 
        assert next(lines, "<EOF>").startswith(expected)
0 comments (0 inline, 0 general)