Home
last modified time | relevance | path

Searched refs:spec_set (Results 1 - 11 of 11) sorted by relevance

/third_party/python/Lib/unittest/
H A Dmock.py428 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 Dtestsealable.py188 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 Dtestcallable.py70 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 Dtestmock.py134 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 Dtestpatch.py685 @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 Dtestmagicmethods.py363 mock = Mock(spec_set=Iterable)
371 mock = Mock(spec_set=NonIterable)
378 mock = MagicMock(spec_set=Iterable)
H A Dtestasync.py394 @patch.object(AsyncClass, 'async_method', spec_set=True)
400 mock = AsyncMock(spec_set=AsyncClass.async_method)
405 mock = MagicMock(spec_set=AsyncClass)
H A Dtesthelpers.py615 mock = create_autospec(spec, spec_set=True)
/third_party/python/Lib/test/test_asyncio/
H A Dtest_unix_events.py660 self.pipe = mock.Mock(spec_set=io.RawIOBase)
837 self.pipe = mock.Mock(spec_set=io.RawIOBase)
H A Dtest_proactor_events.py548 self.sock = mock.Mock(spec_set=socket.socket)
H A Dtest_selector_events.py1076 self.sock = mock.Mock(spec_set=socket.socket)

Completed in 17 milliseconds