Home
last modified time | relevance | path

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

12

/external/python/cpython3/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.py251 a = mock.mock_open()
1845 mocked_open = mock.mock_open(read_data='data')
1855 mocked_open = mock.mock_open(read_data='Remarkable\nNorwegian Blue')
1863 mocked_open = mock.mock_open(read_data='1st line\n2nd line\n3rd line')
1876 mopen = mock.mock_open(read_data='foo\nbarn')
1882 mock_namedtemp = mock.mock_open(mock.MagicMock(name='JLV'))
1892 mopen = mock.mock_open(read_data='foo\nbarn')
1901 _open = mock.mock_open(read_data='foo')
Dtestpatch.py394 def test_open(mock_open): argument
395 m = mock_open.return_value
/external/python/mock/mock/tests/
Dtestwith.py10 from mock import MagicMock, Mock, patch, sentinel, mock_open, call
150 mock = mock_open()
159 mock = mock_open()
171 mock = mock_open()
187 mock_open(mock)
197 mock = mock_open(read_data='foo')
208 mock = mock_open(read_data='foo\nbar\nbaz\n')
220 mock = mock_open(read_data='foo')
230 mock = mock_open(read_data='foo\nbar\nbaz\n')
242 mock = mock_open(read_data='foo\nbar\nbaz\n')
[all …]
Dtestmock.py269 a = mock.mock_open()
1751 mocked_open = mock.mock_open(read_data='data')
1761 mocked_open = mock.mock_open(read_data='Remarkable\nNorwegian Blue')
1770 mock_namedtemp = mock.mock_open(mock.MagicMock(name='JLV'))
1780 mopen = mock.mock_open(read_data='foo\nbarn')
1790 _open = mock.mock_open(read_data='foo')
Dtestpatch.py393 def test_open(mock_open): argument
394 m = mock_open.return_value
/external/toolchain-utils/rust_tools/
Drust_uprev_test.py122 mock_open = mock.mock_open(read_data=self.ebuild_file_before)
124 with mock.patch('builtins.open', mock_open):
126 mock_open.return_value.__enter__().write.assert_called_once_with(
131 mock_open = mock.mock_open(read_data=ebuild_file)
133 with mock.patch('builtins.open', mock_open):
145 mock_open = mock.mock_open(read_data=f'RESTRICT="{before}"')
146 with mock.patch('builtins.open', mock_open):
149 mock_open.return_value.__enter__().write.assert_called_once_with(
207 mock_open = mock.mock_open(read_data=package_before)
208 with mock.patch('builtins.open', mock_open):
[all …]
/external/python/oauth2client/tests/contrib/
Dtest_locked_file.py83 def test_lock_access_error_fallback_mode(self, mock_open): argument
88 mock_open.side_effect = [IOError(errno.ENOENT, '')]
95 def test_lock_non_access_error(self, mock_open): argument
98 mock_open.side_effect = [IOError(errno.EACCES, ''), fh_mock]
105 def test_lock_unexpected_error(self, mock_open): argument
116 def test_lock_timeout_error(self, mock_time, mock_logger, mock_open): argument
131 def test_lock_timeout_error_no_fh(self, mock_time, mock_logger, mock_open): argument
137 mock_open.side_effect = [IOError(errno.ENOENT, ''), fh_mock]
150 def test_lock_retry_success(self, mock_sleep, mock_time, mock_open): argument
/external/python/mock/
DCHANGELOG.rst4 - Issue #31855: :func:`unittest.mock.mock_open` results now respects the
92 - Issue #32933: :func:`unittest.mock.mock_open` now supports iteration over
121 - Issue #26807: mock_open 'files' no longer error on readline at end of file.
140 - Issue #23004: mock_open() now reads binary data correctly when the type of
143 - Issue #21750: mock_open.read_data can now be read from each instance, as it
146 - Issue #18622: unittest.mock.mock_open().reset_mock would recurse infinitely.
194 - Issue #17467: add readline and readlines support to mock_open in
/external/toolchain-utils/crosperf/
Dexperiment_runner_unittest.py413 @mock.patch('builtins.open', new_callable=mock.mock_open)
414 def test_store_results(self, mock_open, mock_top_commands, mock_cleanup, argument
443 self.assertEqual(mock_open.call_count, 0)
479 self.assertEqual(mock_open.call_count, 1)
481 mock_open.assert_called_with('/usr/local/crosperf-results/topstats.log',
483 mock_open().write.assert_called()
Dresults_cache_unittest.py1050 mock.mock_open(read_data=TURBOSTAT_LOG_OUTPUT)) as mo:
1060 with mock.patch('builtins.open', mock.mock_open(read_data='')) as mo:
1089 mock.mock_open(read_data=CPUSTATS_UNIQ_OUTPUT)) as mo:
1106 mock.mock_open(read_data=CPUSTATS_DUPL_OUTPUT)) as mo:
1116 with mock.patch('builtins.open', mock.mock_open(read_data='')) as mo:
1128 with mock.patch('builtins.open', mock.mock_open(read_data=TOP_LOG)) as mo:
1138 with mock.patch('builtins.open', mock.mock_open(read_data='')) as mo:
/external/python/cpython3/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')
/external/python/cpython3/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
/external/toolchain-utils/llvm_tools/
Dupdate_packages_and_run_tests_unittest.py40 mock.mock_open(read_data='')
/external/python/cpython2/Lib/test/
Dtest_sax.py181 def mock_open(*args): function
186 with support.swap_attr(saxutils, 'open', mock_open):
D_mock_backport.py2287 def mock_open(mock=None, read_data=''): function
/external/python/cpython3/Lib/test/
Dtest_sax.py203 def mock_open(*args): function
208 with mock.patch('xml.sax.saxutils.open', side_effect=mock_open):
Dtest_codecs.py1718 mock_open = mock.mock_open()
1719 with mock.patch('builtins.open', mock_open) as file:
/external/python/cpython3/Doc/library/
Dunittest.mock.rst209 from unittest.mock import mock_open
2441 mock_open section in Helpers
2444 .. function:: mock_open(mock=None, read_data=None)
2488 >>> m = mock_open()
2504 >>> with patch('__main__.open', mock_open(read_data='bibble')) as m:
/external/python/google-api-python-client/tests/
Dtest_http.py217 opener = mock.mock_open(file_desc)
/external/pdfium/third_party/pymock/
Dmock.py2319 def mock_open(mock=None, read_data=''): function
/external/python/mock/mock/
Dmock.py2505 def mock_open(mock=None, read_data=''): function

12