def test_get_with_default_encoding_uses_utf8(self): redis = MagicMock() key = MagicMock() redis_hash = RedisHash(redis, key) field = MagicMock() redis_hash.get(field) redis.hget.assert_called_once_with(key, field, encoding='utf-8')
def test_get_gets_field(self): redis = MagicMock() key = MagicMock() redis_hash = RedisHash(redis, key) field = MagicMock() encoding = MagicMock() result = redis_hash.get(field, encoding=encoding) redis.hget.assert_called_once_with(key, field, encoding=encoding) self.assertEqual(result, redis.hget.return_value)