How to use the secretstorage.exceptions.LockedException function in SecretStorage

To help you get started, we’ve selected a few SecretStorage examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github mitya57 / secretstorage / tests / test_unlocking.py View on Github external
def test_lock_unlock(self) -> None:
		self.assertFalse(self.collection.is_locked())
		self.collection.lock()
		self.assertTrue(self.collection.is_locked())
		self.assertRaises(LockedException, self.collection.ensure_not_locked)
		item, = self.collection.search_items({"number": "1"})
		self.assertRaises(LockedException, item.ensure_not_locked)
		self.assertIs(self.collection.unlock(), False)
		self.assertFalse(self.collection.is_locked())
		self.collection.ensure_not_locked()
github mitya57 / secretstorage / tests / test_unlocking.py View on Github external
def test_lock_unlock(self) -> None:
		self.assertFalse(self.collection.is_locked())
		self.collection.lock()
		self.assertTrue(self.collection.is_locked())
		self.assertRaises(LockedException, self.collection.ensure_not_locked)
		item, = self.collection.search_items({"number": "1"})
		self.assertRaises(LockedException, item.ensure_not_locked)
		self.assertIs(self.collection.unlock(), False)
		self.assertFalse(self.collection.is_locked())
		self.collection.ensure_not_locked()
github mitya57 / secretstorage / secretstorage / item.py View on Github external
def ensure_not_locked(self) -> None:
		"""If collection is locked, raises
		:exc:`~secretstorage.exceptions.LockedException`."""
		if self.is_locked():
			raise LockedException('Item is locked!')
github n1nj4sec / pupy / pupy / packages / linux / all / secretstorage / collection.py View on Github external
def ensure_not_locked(self):
        """If collection is locked, raises
        :exc:`~secretstorage.exceptions.LockedException`."""
        if self.is_locked():
            raise LockedException('Collection is locked!')
github mitya57 / secretstorage / secretstorage / collection.py View on Github external
def ensure_not_locked(self) -> None:
		"""If collection is locked, raises
		:exc:`~secretstorage.exceptions.LockedException`."""
		if self.is_locked():
			raise LockedException('Collection is locked!')
github n1nj4sec / pupy / pupy / packages / linux / all / secretstorage / item.py View on Github external
def ensure_not_locked(self):
        """If collection is locked, raises
        :exc:`~secretstorage.exceptions.LockedException`."""
        if self.is_locked():
            raise LockedException('Item is locked!')