Home
last modified time | relevance | path

Searched refs:spec_set (Results 1 – 20 of 20) sorted by relevance

/external/python/cpython2/Lib/test/
D_mock_backport.py381 self, spec=None, wraps=None, name=None, spec_set=None, argument
394 if spec_set is not None:
395 spec = spec_set
396 spec_set = True
400 self._mock_add_spec(spec, spec_set, _spec_as_instance, _eat_self)
419 spec, wraps, name, spec_set, parent,
437 def mock_add_spec(self, spec, spec_set=False): argument
443 self._mock_add_spec(spec, spec_set)
446 def _mock_add_spec(self, spec, spec_set, _spec_as_instance=False, argument
464 __dict__['_spec_set'] = spec_set
[all …]
/external/pdfium/third_party/pymock/
Dmock.py478 self, spec=None, wraps=None, name=None, spec_set=None, argument
491 if spec_set is not None:
492 spec = spec_set
493 spec_set = True
495 self._mock_add_spec(spec, spec_set)
513 spec, wraps, name, spec_set, parent,
531 def mock_add_spec(self, spec, spec_set=False): argument
537 self._mock_add_spec(spec, spec_set)
540 def _mock_add_spec(self, spec, spec_set): argument
553 __dict__['_spec_set'] = spec_set
[all …]
/external/python/mock/mock/
Dmock.py489 self, spec=None, wraps=None, name=None, spec_set=None, argument
503 if spec_set is not None:
504 spec = spec_set
505 spec_set = True
509 self._mock_add_spec(spec, spec_set, _spec_as_instance, _eat_self)
528 spec, wraps, name, spec_set, parent,
546 def mock_add_spec(self, spec, spec_set=False): argument
552 self._mock_add_spec(spec, spec_set)
555 def _mock_add_spec(self, spec, spec_set, _spec_as_instance=False, argument
573 __dict__['_spec_set'] = spec_set
[all …]
/external/python/cpython3/Lib/unittest/
Dmock.py417 self, spec=None, wraps=None, name=None, spec_set=None, argument
431 if spec_set is not None:
432 spec = spec_set
433 spec_set = True
437 self._mock_add_spec(spec, spec_set, _spec_as_instance, _eat_self)
456 spec, wraps, name, spec_set, parent,
476 def mock_add_spec(self, spec, spec_set=False): argument
482 self._mock_add_spec(spec, spec_set)
485 def _mock_add_spec(self, spec, spec_set, _spec_as_instance=False, argument
508 __dict__['_spec_set'] = spec_set
[all …]
/external/python/mock/mock/tests/
Dtestcallable.py70 patcher = patch('%s.X' % __name__, spec_set=True)
91 patcher = patch('%s.X' % __name__, spec_set=X())
Dtestmock.py147 mock = Mock(spec_set=X)
150 mock = Mock(spec_set=X())
783 mock = Mock(spec_set=X)
786 mock = Mock(spec_set=X())
805 mock = Mock(spec_set=X)
810 mock = Mock(spec_set=X())
821 mock = Mock(spec_set=X)
858 mock = Mock(spec_set=Foo)
866 mock = Mock(spec_set=Foo())
883 s = SubClass(spec_set=SubClass)
[all …]
Dtestpatch.py683 @patch('%s.SomeClass' % __name__, spec=SomeClass, spec_set=True)
689 @patch.object(support, 'SomeClass', spec=SomeClass, spec_set=True)
694 @patch('%s.SomeClass' % __name__, spec_set=True)
700 @patch.object(support, 'SomeClass', spec_set=True)
708 @patch('%s.SomeClass' % __name__, spec_set=True)
1103 patcher = patch(foo_name, new_callable=Bar, spec_set=Bar)
1106 self.assertEqual(Bar.kwargs, dict(spec_set=Bar))
1396 patcher = patch.multiple(Foo, foo=DEFAULT, spec_set=['a', 'b'])
1716 p = patch(MODNAME, spec_set=0, **{kwarg: 0})
1727 p = patch(MODNAME, spec=False, spec_set=False, autospec=False)
[all …]
Dtestmagicmethods.py404 mock = Mock(spec_set=Iterable)
412 mock = Mock(spec_set=NonIterable)
419 mock = MagicMock(spec_set=Iterable)
Dtesthelpers.py587 mock = create_autospec(spec, spec_set=True)
/external/python/cpython3/Lib/unittest/test/testmock/
Dtestcallable.py70 patcher = patch('%s.X' % __name__, spec_set=True)
91 patcher = patch('%s.X' % __name__, spec_set=X())
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)
1113 patcher = patch(foo_name, new_callable=Bar, spec_set=Bar)
1116 self.assertEqual(Bar.kwargs, dict(spec_set=Bar))
1406 patcher = patch.multiple(Foo, foo=DEFAULT, spec_set=['a', 'b'])
1722 p = patch(MODNAME, spec_set=0, **{kwarg: 0})
1733 p = patch(MODNAME, spec=False, spec_set=False, autospec=False)
[all …]
Dtestmock.py128 mock = Mock(spec_set=X)
131 mock = Mock(spec_set=X())
829 mock = Mock(spec_set=X)
832 mock = Mock(spec_set=X())
849 mock = Mock(spec_set=X)
852 mock = Mock(spec_set=X())
863 mock = Mock(spec_set=X)
889 s = SubClass(spec_set=SubClass)
1720 klasses.append(lambda K=Klass: K(spec_set=Anything))
1723 for kwargs in dict(), dict(spec_set=True):
[all …]
Dtestmagicmethods.py363 mock = Mock(spec_set=Iterable)
371 mock = Mock(spec_set=NonIterable)
378 mock = MagicMock(spec_set=Iterable)
Dtestasync.py367 @patch.object(AsyncClass, 'async_method', spec_set=True)
373 mock = AsyncMock(spec_set=AsyncClass.async_method)
378 mock = MagicMock(spec_set=AsyncClass)
Dtesthelpers.py615 mock = create_autospec(spec, spec_set=True)
/external/python/cpython3/Doc/library/
Dunittest.mock.rst228 .. class:: Mock(spec=None, side_effect=None, return_value=DEFAULT, wraps=None, name=None, spec_set=…
243 * *spec_set*: A stricter variant of *spec*. If used, attempting to *set*
245 *spec_set* will raise an :exc:`AttributeError`.
422 .. method:: mock_add_spec(spec, spec_set=False)
428 If *spec_set* is true then only attributes on the spec can be set.
752 .. class:: NonCallableMock(spec=None, wraps=None, name=None, spec_set=None, **kwargs)
759 :attr:`spec_set` are able to pass :func:`isinstance` tests:
764 >>> mock = Mock(spec_set=SomeClass())
797 A callable mock which was created with a *spec* (or a *spec_set*) will
858 …ec=None, side_effect=None, return_value=DEFAULT, wraps=None, name=None, spec_set=None, unsafe=Fals…
[all …]
Dunittest.mock-examples.rst360 *spec_set* instead of *spec*.
1002 (or *spec_set*) argument so that the ``MagicMock`` created only has
1005 >>> mock = MagicMock(spec_set=dict)
/external/python/cpython3/Lib/test/test_asyncio/
Dtest_unix_events.py651 self.pipe = mock.Mock(spec_set=io.RawIOBase)
828 self.pipe = mock.Mock(spec_set=io.RawIOBase)
Dtest_proactor_events.py484 self.sock = mock.Mock(spec_set=socket.socket)
Dtest_selector_events.py1079 self.sock = mock.Mock(spec_set=socket.socket)