Searched refs:spec_set (Results 1 - 11 of 11) sorted by relevance
/third_party/python/Lib/unittest/ |
H A D | mock.py | 428 spec_arg = bound_args.get('spec_set', bound_args.get('spec')) 437 self, spec=None, wraps=None, name=None, spec_set=None, 451 if spec_set is not None: 452 spec = spec_set 453 spec_set = True 457 self._mock_add_spec(spec, spec_set, _spec_as_instance, _eat_self) 476 spec, wraps, name, spec_set, parent, 496 def mock_add_spec(self, spec, spec_set=False): 501 If `spec_set` is True then only attributes on the spec can be set.""" 502 self._mock_add_spec(spec, spec_set) [all...] |
/third_party/python/Lib/unittest/test/testmock/ |
H A D | testsealable.py | 188 for spec_set in (True, False): 189 with self.subTest(spec_set=spec_set): 190 foo = mock.create_autospec(Foo, spec_set=spec_set)
|
H A D | testcallable.py | 70 patcher = patch('%s.X' % __name__, spec_set=True) 91 patcher = patch('%s.X' % __name__, spec_set=X()) 109 for arg in 'spec', 'spec_set':
|
H A D | testmock.py | 134 mock = Mock(spec_set=X) 135 self.assertIn(" spec_set='X' ", repr(mock)) 137 mock = Mock(spec_set=X()) 138 self.assertIn(" spec_set='X' ", repr(mock)) 227 "Cannot spec attr 'B' as the spec_set "): 228 mock.patch.object(A, 'B', spec_set=A.B).start() 230 "Cannot spec attr 'B' as the spec_set "): 231 mock.patch.object(A, 'B', spec_set=A.B).start() 564 for arg in 'spec', 'spec_set': 865 mock = Mock(spec_set [all...] |
H A D | testpatch.py | 685 @patch('%s.SomeClass' % __name__, spec=SomeClass, spec_set=True) 691 @patch.object(support, 'SomeClass', spec=SomeClass, spec_set=True) 696 @patch('%s.SomeClass' % __name__, spec_set=True) 702 @patch.object(support, 'SomeClass', spec_set=True) 710 @patch('%s.SomeClass' % __name__, spec_set=True) 1143 patcher = patch(foo_name, new_callable=Bar, spec_set=Bar) 1146 self.assertEqual(Bar.kwargs, dict(spec_set=Bar)) 1194 for arg in 'spec', 'spec_set': 1434 # if spec_set works then we can assume that spec and autospec also 1436 patcher = patch.multiple(Foo, foo=DEFAULT, spec_set [all...] |
H A D | testmagicmethods.py | 363 mock = Mock(spec_set=Iterable) 371 mock = Mock(spec_set=NonIterable) 378 mock = MagicMock(spec_set=Iterable)
|
H A D | testasync.py | 394 @patch.object(AsyncClass, 'async_method', spec_set=True) 400 mock = AsyncMock(spec_set=AsyncClass.async_method) 405 mock = MagicMock(spec_set=AsyncClass)
|
H A D | testhelpers.py | 615 mock = create_autospec(spec, spec_set=True)
|
/third_party/python/Lib/test/test_asyncio/ |
H A D | test_unix_events.py | 660 self.pipe = mock.Mock(spec_set=io.RawIOBase) 837 self.pipe = mock.Mock(spec_set=io.RawIOBase)
|
H A D | test_proactor_events.py | 548 self.sock = mock.Mock(spec_set=socket.socket)
|
H A D | test_selector_events.py | 1076 self.sock = mock.Mock(spec_set=socket.socket)
|
Completed in 15 milliseconds