def test_total_size(self): store = self.get_store(u'.') store.register_suffix('dsc') store.add(StringIO('goodbye'), '123123') store.add(StringIO('goodbye2'), '123123', 'dsc') # these get gzipped - content should be stable self.assertEqual(store.total_size(), (2, 55))
def test_add_and_retrieve(self): store = self.get_store() store.add(StringIO('hello'), 'aa') self.assertNotEqual(store.get('aa'), None) self.assertEqual(store.get('aa').read(), 'hello') store.add(StringIO('hello world'), 'bb') self.assertNotEqual(store.get('bb'), None) self.assertEqual(store.get('bb').read(), 'hello world')
def fill_store(self, store): store.add(StringIO('hello'), 'a') store.add(StringIO('other'), 'b') store.add(StringIO('something'), 'c') store.add(StringIO('goodbye'), '123123')
def test_total_size(self): store = self.get_store() store.add(StringIO('goodbye'), '123123') store.add(StringIO('goodbye2'), '123123.dsc') self.assertEqual(store.total_size(), (2, 15))