def test__observation_valid_many(aggobs):
    out = utils._observation_valid(nindex,
                                   '09ed7cf6-ea0b-11e9-a7da-f4939feddd82',
                                   aggobs)
    pdt.assert_series_equal(
        out,
        pd.Series(
            [True, True, True, True, True, False, False, True, True, True],
            index=nindex))
def test__observation_valid_deleted_before(aggobs):
    out = utils._observation_valid(nindex,
                                   '67ea9200-ea0e-11e9-832b-f4939feddd82',
                                   aggobs)
    pdt.assert_series_equal(out, pd.Series(False, index=nindex))
def test__observation_valid_deleted(aggobs):
    with pytest.raises(ValueError):
        utils._observation_valid(nindex,
                                 '0fe9f2ba-ea0b-11e9-a7da-f4939feddd82',
                                 aggobs)
def test__observation_valid_ended(aggobs):
    out = utils._observation_valid(nindex,
                                   'f3e310ba-ea0a-11e9-a7da-f4939feddd82',
                                   aggobs)
    pdt.assert_series_equal(out,
                            pd.Series([False] * 6 + [True] * 4, index=nindex))
def test__observation_valid(aggobs):
    out = utils._observation_valid(nindex,
                                   'f2844284-ea0a-11e9-a7da-f4939feddd82',
                                   aggobs)
    pdt.assert_series_equal(out, pd.Series(True, index=nindex))