Commit 33c5f053 authored by Arnaud Campeas's avatar Arnaud Campeas
Browse files

tests: discuss the get_history with delta api

get_history with deltabefore and deltaafter might be more
liberal when constraining before/after values

e.g. don't assume deltabefore(/after) implies we want to
constrain the other side
parent a27ecf594376
......@@ -683,6 +683,28 @@ def test_history_delta(engine, tsh):
assert_df("""
insertion_date value_date
2018-01-01 00:00:00+00:00 2017-12-31 23:00:00+00:00 1.0
2018-01-01 00:00:00+00:00 1.0
2018-01-01 01:00:00+00:00 1.0
2018-01-01 02:00:00+00:00 1.0
2018-01-01 03:00:00+00:00 1.0
2018-01-01 04:00:00+00:00 1.0
2018-01-02 00:00:00+00:00 2017-12-31 23:00:00+00:00 1.0
2018-01-01 00:00:00+00:00 1.0
2018-01-01 01:00:00+00:00 1.0
2018-01-01 02:00:00+00:00 1.0
2018-01-01 03:00:00+00:00 1.0
2018-01-01 04:00:00+00:00 1.0
2018-01-01 23:00:00+00:00 2.0
2018-01-02 00:00:00+00:00 2.0
2018-01-02 01:00:00+00:00 2.0
2018-01-02 02:00:00+00:00 2.0
2018-01-02 03:00:00+00:00 2.0
2018-01-02 04:00:00+00:00 2.0
""", tsh.get_history(engine, 'hd'))
assert_df("""
insertion_date value_date
2018-01-01 00:00:00+00:00 2018-01-01 00:00:00+00:00 1.0
2018-01-01 01:00:00+00:00 1.0
2018-01-01 02:00:00+00:00 1.0
......@@ -691,6 +713,8 @@ insertion_date value_date
2018-01-02 02:00:00+00:00 2.0
""", tsh.get_history(engine, 'hd', deltaafter=timedelta(hours=2)))
# this test puts the feature in light: the value date of 23 h disapeared
# auc: I consider this a feature, but I agree we can be more liberal
assert_df("""
insertion_date value_date
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment