File diff ae3e4617d31e → c9382a26044a
tests/test_historical.py
Show inline comments
...
 
@@ -225,8 +225,8 @@ def test_from_date_rates(alternate_responder, output, any_date, output_format):
 
                          from_date=any_date, output_format=output_format,
 
                          denomination='USD')
 
    lines = lines_from_run(config, output)
 
    check_fx_amount(config, lines, '1 ANG', '2.051', 'AED', None, '1.909')
 
    check_fx_amount(config, lines, '1 AED', '0.487', 'ANG', None, '0.523')
 
    check_fx_amount(config, lines, '1 ANG', '1.909', 'AED', None, '2.051')
 
    check_fx_amount(config, lines, '1 AED', '0.523', 'ANG', None, '0.487')
 
    assert next(lines, None) is None
 

	
 
@parametrize_format
...
 
@@ -236,8 +236,8 @@ def test_from_date_conversion(alternate_responder, output, any_date, output_form
 
                          from_date=any_date, output_format=output_format,
 
                          denomination='USD')
 
    lines = lines_from_run(config, output)
 
    check_fx_amount(config, lines, '10.00 ANG', '0.558', 'USD', '$', '0.507')
 
    check_fx_amount(config, lines, '20.52 AED', '0.272', 'USD', '$', '0.265')
 
    check_fx_amount(config, lines, '10.00 ANG', '0.507', 'USD', '$', '0.558')
 
    check_fx_amount(config, lines, '19.10 AED', '0.265', 'USD', '$', '0.272')
 
    assert next(lines, None) is None
 

	
 
@parametrize_format
...
 
@@ -252,11 +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
 
    expect_rate = f' @ {match.group(1)}\n'
 
        match = re.search(r'\{=?\d+\.\d+ USD\}', next(lines, "<EOF>"))
 
    assert match is not None
 
    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 next(lines, "<EOF>").endswith(expect_rate)
 
        assert match.group(0) in next(lines, "<EOF>")