How to use the pottery.KeyExistsError function in pottery

To help you get started, we’ve selected a few pottery 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 brainix / pottery / tests / test_dict.py View on Github external
def test_keyexistserror_repr(self):
        d = RedisDict(key='pottery:tel', sape=4139, guido=4127, jack=4098)
        d   # Workaround for Pyflakes.  :-(
        try:
            RedisDict(key='pottery:tel', sape=4139, guido=4127, jack=4098)
        except KeyExistsError as wtf:
            assert repr(wtf) == (
                "KeyExistsError(redis=Pipeline>>, "
                "key='pottery:tel')"
            )
        else:  # pragma: no cover
            self.fail(msg='KeyExistsError not raised')
github brainix / pottery / tests / test_list.py View on Github external
def test_keyexistserror(self):
        squares = RedisList((1, 4, 9, 16, 25), key=self._KEY)
        squares     # Workaround for Pyflakes.  :-(
        with self.assertRaises(KeyExistsError):
            RedisList((1, 4, 9, 16, 25), key=self._KEY)
github brainix / pottery / tests / test_set.py View on Github external
def test_keyexistserror(self):
        fruits = {'apple', 'orange', 'apple', 'pear', 'orange', 'banana'}
        basket = RedisSet(fruits, key='pottery:basket')
        basket  # Workaround for Pyflakes.  :-(
        with self.assertRaises(KeyExistsError):
            RedisSet(fruits, key='pottery:basket')
github brainix / pottery / tests / test_dict.py View on Github external
def test_keyexistserror_raised(self):
        d = RedisDict(key='pottery:tel', sape=4139, guido=4127, jack=4098)
        d   # Workaround for Pyflakes.  :-(
        with self.assertRaises(KeyExistsError):
            RedisDict(key='pottery:tel', sape=4139, guido=4127, jack=4098)