def test__clear(self): logging.info('***** _clear') store = Store() with self.assertRaises(NotImplementedError): store._clear('sca.lar')
def test__set(self): logging.info('***** _set') store = Store() with self.assertRaises(NotImplementedError): store._set('sca.lar', 'test')
def test_init(self): logging.info('***** init') store = Store() self.assertEqual(store.context, None) self.assertTrue(store.lock is not None) store = Store(context=self.context) self.assertEqual(store.context, self.context)
def test_to_text(self): logging.info('***** to_text') store = Store() self.assertEqual(store.to_text('text'), '"text"') self.assertEqual(store.to_text(['hello', 'world']), '["hello", "world"]') self.assertEqual(store.to_text({'hello': 'world'}), '{"hello": "world"}')
def test_from_text(self): logging.info('***** from_text') store = Store() value = 'text' self.assertEqual(store.from_text(store.to_text(value)), value) value = ['hello', 'world', 123, 4.56, ['another', 'list']] self.assertEqual(store.from_text(store.to_text(value)), value) value = {'hello': 'world'} self.assertEqual(store.from_text(store.to_text(value)), value)
def test_bond(self): logging.info('***** bond') store = Store(context=self.context) store.bond() store.bond(id='*123')
def test_check(self): logging.info('***** check') store = Store(context=self.context) store.check()