Skip to content

MockMemcacheClient should always return str or bytes (?) #649

Description

@snarfed

Hi all! Right now, if you set an int or float value in a MockMemcacheClient (with the default serde) and then get it, you get the same native int or float. For parity with production memcached, get should always return these as bytes, right? Eg right now this happens:

>>> mc = MockMemcacheClient()
>>> mc.set('x', 3)
True
>>> mc.get('x')
3

...which doesn't match real memcache:

>>> mc = PooledClient(...)
>>> mc.set('x', 3)
True
>>> mc.get('x')
b'3'

I started on a PR for this in master...snarfed:pymemcache:MockMemcacheClient-get-int-serde , but it's pretty awkward, I kind of doubt it's the right direction.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions