'Test writing data with the same date as existing data in our file.'

def test_append_to_same_day(self):

    sid = 1
    first_minute = self.market_opens[TEST_CALENDAR_START]
    data = DataFrame(data={'open': [10.0], 'high': [20.0], 'low': [30.0], 'close': [40.0], 'volume': [50.0]}, index=[first_minute])
    self.writer.write_sid(sid, data)
    second_minute = (first_minute + Timedelta(minutes=1))
    new_data = DataFrame(data={'open': [5.0], 'high': [10.0], 'low': [3.0], 'close': [7.0], 'volume': [10.0]}, index=[second_minute])
    self.writer.write_sid(sid, new_data)
    open_price = self.reader.get_value(sid, second_minute, 'open')
    self.assertEquals(5.0, open_price)
    high_price = self.reader.get_value(sid, second_minute, 'high')
    self.assertEquals(10.0, high_price)
    low_price = self.reader.get_value(sid, second_minute, 'low')
    self.assertEquals(3.0, low_price)
    close_price = self.reader.get_value(sid, second_minute, 'close')
    self.assertEquals(7.0, close_price)
    volume_price = self.reader.get_value(sid, second_minute, 'volume')
    self.assertEquals(10.0, volume_price)
