Message213891
http://docs.python.org/3.4/library/unittest.mock-examples.html
Section 26.5.3.9. Mocking a dictionary with MagicMock
In the Note area:
>>> mock.__setitem__ = Mock(side_effect=getitem)
>>> mock.__getitem__ = Mock(side_effect=setitem)
I think these are swapped; should be:
>>> mock.__setitem__ = Mock(side_effect=setitem)
>>> mock.__getitem__ = Mock(side_effect=getitem) |
|
Date |
User |
Action |
Args |
2014-03-17 20:34:47 | chris-buccella | set | recipients:
+ chris-buccella, docs@python |
2014-03-17 20:34:47 | chris-buccella | set | messageid: <1395088487.87.0.432114186877.issue20963@psf.upfronthosting.co.za> |
2014-03-17 20:34:47 | chris-buccella | link | issue20963 messages |
2014-03-17 20:34:47 | chris-buccella | create | |
|