(self)
| 178 | self.assertEqual(mock.mock_calls, expected_calls) |
| 179 | |
| 180 | def test_explicit_mock(self): |
| 181 | mock = MagicMock() |
| 182 | mock_open(mock) |
| 183 | |
| 184 | with patch('%s.open' % __name__, mock, create=True) as patched: |
| 185 | self.assertIs(patched, mock) |
| 186 | open('foo') |
| 187 | |
| 188 | mock.assert_called_once_with('foo') |
| 189 | |
| 190 | |
| 191 | def test_read_data(self): |