def test_ohlc_conflator_str_dirty(): c = conflateddict.OHLCConflator() for i in range(random.randint(1, 10)): c[i] = i expected_str = '<OHLCConflator dirty:{dirty} entries:{entries}>'.format( dirty=i + 1, entries=i + 1) assert str(c) == expected_str
def test_ohlc_conflator_str_clean(): c = conflateddict.OHLCConflator() assert str(c) == '<OHLCConflator dirty:0 entries:0>'
def test_ohlc_conflator_low(): c = conflateddict.OHLCConflator() for i in range(5): c[1] = i c[1] = -1 assert c[1] == (0, 4, -1, -1)
def test_ohlc_conflator_close(): c = conflateddict.OHLCConflator() for i in range(5): c[1] = i c[1] = 2 assert c[1] == (0, 4, 0, 2)
def test_ohlc_conflator_high(): c = conflateddict.OHLCConflator() for i in range(5): c[1] = i c[1] = 5 assert c[1] == (0, 5, 0, 5)