Package: python-mock
Version: 1.0.1-2
Severity: normal
Tags: upstream

>>> import mock
>>> d = {1:2,3:4}
>>> m = mock.MagicMock(spec_set=d.__class__, wraps=d)
>>> print m.items()
[(1, 2), (3, 4)]
>>> m.update({5:6})
>>> print m.items()
[(1, 2), (3, 4), (5, 6)]

So far so good. m behaves like d, because it wraps it.

However:

>>> m[7] = 8
>>> print m.items()
[(1, 2), (3, 4), (5, 6)]]

Unfortunately, __setitem__ is not properly mocked on wrapped dicts.



-- System Information:
Debian Release: jessie/sid
  APT prefers unstable
  APT policy: (500, 'unstable'), (1, 'experimental')
Architecture: amd64 (x86_64)
Foreign Architectures: i386

Kernel: Linux 3.10-rc7-amd64 (SMP w/4 CPU cores)
Locale: LANG=en_NZ, LC_CTYPE=en_NZ.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash

Versions of packages python-mock depends on:
ii  python  2.7.5-2

python-mock recommends no packages.

Versions of packages python-mock suggests:
pn  python-mock-doc  <none>

-- no debconf information

-- 
 .''`.   martin f. krafft <madduck@d.o>      Related projects:
: :'  :  proud Debian developer               http://debiansystem.info
`. `'`   http://people.debian.org/~madduck    http://vcs-pkg.org
  `-  Debian - when you have better things to do than fixing systems

Attachment: digital_signature_gpg.asc
Description: Digital signature (see http://martin-krafft.net/gpg/sig-policy/999bbcc4/current)

Reply via email to