Exemplo n.º 1
0
def mock_storage(target = None):
        if target:
            target._ws.stop()

        sh = StorageHandler(STORAGE)
        sh._ws = Mock('send')
        return sh
Exemplo n.º 2
0
 def testWrongMessage(self):
     self.store = StorageHandler()
     # The first should not raise, but catch and log the error
     self.store.set("storage.command.set.foo", { 'omg_wrong_key' : 'deep' })
     with self.assertRaises(KeyError):
         # But this one should raise
         self.store._store['foo']
Exemplo n.º 3
0
 def testEmptyStorage(self):
     self.store = StorageHandler()
     self.store._ws = Mock('send')
     self.assertEqual(self.store._store, {})