Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
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')
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)
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')
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)