def test_add_point(self): """Test add_point().""" sname = 'tmp/add-points' tsd.create_series(sname, False, False) lines = tsd.recent_data(sname, True) self.assertEqual([], lines) tsd.add_point(sname, '2013-04-01', 3.1415) lines = tsd.recent_data(sname, True) self.assertEqual(['2013-04-01\t3.1415'], lines)
def test_recent_data(self): """Test recent_data(). """ lines = tsd.recent_data('test-short', False) short_expected = ['2011-01-03 4', '2011-01-05 8'] self.assertEqual(lines, short_expected) lines = tsd.recent_data('test-short', True) short_expected_verbose = ['2011-01-01 2', '2011-01-03 4', \ '2011-01-05 8'] self.assertEqual(lines, short_expected_verbose)