Home
last modified time | relevance | path

Searched refs:mock_open (Results 1 – 18 of 18) sorted by relevance

/third_party/python/Lib/unittest/test/testmock/
Dtestwith.py5 from unittest.mock import MagicMock, Mock, patch, sentinel, mock_open, call
145 mock = mock_open()
154 mock = mock_open()
166 mock = mock_open()
182 mock_open(mock)
192 mock = mock_open(read_data='foo')
203 mock = mock_open(read_data='foo\nbar\nbaz\n')
215 mock = mock_open(read_data='foo')
225 mock = mock_open(read_data='foo\nbar\nbaz\n')
239 mock = mock_open(read_data='foo\nbar\nbaz\n')
[all …]
Dtestmock.py279 a = mock.mock_open()
1882 mocked_open = mock.mock_open(read_data='data')
1892 mocked_open = mock.mock_open(read_data='Remarkable\nNorwegian Blue')
1900 mocked_open = mock.mock_open(read_data='1st line\n2nd line\n3rd line')
1913 mopen = mock.mock_open(read_data='foo\nbarn')
1919 mock_namedtemp = mock.mock_open(mock.MagicMock(name='JLV'))
1929 mopen = mock.mock_open(read_data='foo\nbarn')
1938 _open = mock.mock_open(read_data='foo')
Dtestpatch.py394 def test_open(mock_open): argument
395 m = mock_open.return_value
/third_party/python/Lib/idlelib/idle_test/
Dtest_outwin.py148 def test_file_line_helper(self, mock_open): argument
162 mock_open.assert_called_with(expected_output[0], 'r')
/third_party/python/Lib/test/
Dtest_mimetypes.py83 return_value=fp) as mock_open:
85 mock_open.assert_called_with(filename, encoding='utf-8')
Dtest_sax.py207 def mock_open(*args): function
212 with mock.patch('xml.sax.saxutils.open', side_effect=mock_open):
Dtest_codecs.py1732 mock_open = mock.mock_open()
1733 with mock.patch('builtins.open', mock_open) as file:
/third_party/python/Misc/NEWS.d/
D3.5.0rc1.rst63 mock_open() now reads binary data correctly when the type of read_data is
D3.5.0b4.rst179 unittest.mock.mock_open().reset_mock would recurse infinitely. Patch from
D3.5.0b3.rst72 mock_open.read_data can now be read from each instance, as it could in
D3.8.0b1.rst752 :func:`unittest.mock.mock_open`
1385 :func:`unittest.mock.mock_open` results now respects the argument of
D3.6.0a1.rst965 mock_open 'files' no longer error on readline at end of file. Patch from
2973 unittest.mock.mock_open().reset_mock would recurse infinitely. Patch from
D3.5.2rc1.rst603 mock_open 'files' no longer error on readline at end of file. Patch from
D3.8.0a1.rst4956 :func:`unittest.mock.mock_open` now supports iteration over the file
/third_party/python/Doc/library/
Dunittest.mock.rst209 from unittest.mock import mock_open
2442 mock_open section in Helpers
2445 .. function:: mock_open(mock=None, read_data=None)
2489 >>> m = mock_open()
2505 >>> with patch('__main__.open', mock_open(read_data='bibble')) as m:
/third_party/python/Lib/unittest/
Dmock.py2815 def mock_open(mock=None, read_data=''): function
/third_party/python/Doc/whatsnew/
D3.4.rst1713 :func:`~mock.mock_open` objects now have ``readline`` and ``readlines``
/third_party/python/Misc/
DHISTORY429 - Issue #23004: mock_open() now reads binary data correctly when the type of
470 - Issue #21750: mock_open.read_data can now be read from each instance, as it
475 - Issue #18622: unittest.mock.mock_open().reset_mock would recurse infinitely.
5200 - Issue #17467: add readline and readlines support to mock_open in