'Test we can parse a standard file.'

def testBasicParsing(self):

    history_file = os.path.join(self.base_path, 'parser_test', 'History2')
    history = chrome_history.ChromeParser(open(history_file, 'rb'))
    entries = [x for x in history.Parse()]
    try:
        dt1 = datetime.datetime(1970, 1, 1)
        dt1 += datetime.timedelta(microseconds=entries[0][0])
    except (TypeError, ValueError):
        dt1 = entries[0][0]
    try:
        dt2 = datetime.datetime(1970, 1, 1)
        dt2 += datetime.timedelta(microseconds=entries[(-1)][0])
    except (TypeError, ValueError):
        dt2 = entries[(-1)][0]
    time_results = [x[0] for x in entries]
    self.assertEqual(time_results, sorted(time_results))
    self.assertEqual(str(dt1), '2013-05-03    15:11:26.556635')
    self.assertTrue(entries[0][2].startswith('https://www.google.ch/search?q=why+you+shouldn'))
    self.assertEqual(str(dt2), '2013-05-03    15:11:39.763984')
    self.assertTrue(entries[(-1)][2].startswith('http://www.test.ch/'))
    self.assertEqual(len(entries), 4)
