def setUp(self): self.application = ImiguApplication(helper.datadir, SH()) self.application.dbm._mtime = 1291167000 self.open_time = 1291167000 self.close_time = 1291186800 key = helper.sample_key() sample = helper.sample() sample[key]['timestamp'] = 1291167000 self.application.dbm.reportstore.update(sample)
def test_init_store(self): filename = '%s/dstore.dump' % helper.datadir store = DictStore.open(filename) rstore = Report(store) sample = helper.sample() rstore.update(sample) key = 'SH000001' self.assertEqual(rstore[key], sample[key]) store.close() self.assertRaises(AssertionError, rstore.set, key, sample) self.assertRaises(AssertionError, rstore.get, key) store = DictStore.open(filename) rstore = Report(store) self.assertEqual(rstore[key], sample[key])
def test_init_store(self): filename = "%s/dstore.dump" % helper.datadir store = DictStore.open(filename) rstore = Report(store) sample = helper.sample() rstore.update(sample) key = "SH000001" self.assertEqual(rstore[key], sample[key]) store.close() self.assertRaises(AssertionError, rstore.set, key, sample) self.assertRaises(AssertionError, rstore.get, key) store = DictStore.open(filename) rstore = Report(store) self.assertEqual(rstore[key], sample[key])