def test_key_hashing(self): # hashing disabled rs = Rediset(hash_generated_keys=False) key = rs.create_key('foo') self.assertEqual(key, 'foo') key = rs.create_key('foo', generated=True) self.assertEqual(key, 'rediset:foo') # hashing enabled rs = Rediset(hash_generated_keys=True) key = rs.create_key('foo') self.assertEqual(key, 'foo') key = rs.create_key('foo', generated=True) self.assertEqual(key, 'rediset:acbd18db4cc2f85cedef654fccc4a4d8')
def test_key_generation(self): rs = Rediset(key_prefix='some-prefix') key = rs.create_key('foo') self.assertEqual(key, 'some-prefix:foo')