Home
last modified time | relevance | path

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

/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/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/python/cpython3/Lib/unittest/
Dmock.py384 self, spec=None, wraps=None, name=None, spec_set=None, argument
398 if spec_set is not None:
399 spec = spec_set
400 spec_set = True
404 self._mock_add_spec(spec, spec_set, _spec_as_instance, _eat_self)
423 spec, wraps, name, spec_set, parent,
441 def mock_add_spec(self, spec, spec_set=False): argument
447 self._mock_add_spec(spec, spec_set)
450 def _mock_add_spec(self, spec, spec_set, _spec_as_instance=False, argument
468 __dict__['_spec_set'] = spec_set
[all …]
/external/python/mock/mock/
Dmock.py498 self, spec=None, wraps=None, name=None, spec_set=None, argument
511 if spec_set is not None:
512 spec = spec_set
513 spec_set = True
517 self._mock_add_spec(spec, spec_set, _spec_as_instance, _eat_self)
536 spec, wraps, name, spec_set, parent,
554 def mock_add_spec(self, spec, spec_set=False): argument
560 self._mock_add_spec(spec, spec_set)
563 def _mock_add_spec(self, spec, spec_set, _spec_as_instance=False, argument
581 __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.py135 mock = Mock(spec_set=X)
138 mock = Mock(spec_set=X())
636 mock = Mock(spec_set=X)
639 mock = Mock(spec_set=X())
650 mock = Mock(spec_set=X)
687 mock = Mock(spec_set=Foo)
695 mock = Mock(spec_set=Foo())
712 s = SubClass(spec_set=SubClass)
1340 klasses.append(lambda K=Klass: K(spec_set=Anything))
1343 for kwargs in dict(), dict(spec_set=True):
[all …]
Dtestpatch.py715 @patch('%s.SomeClass' % __name__, spec_set=SomeClass)
721 @patch.object(support, 'SomeClass', spec_set=SomeClass)
726 @patch('%s.SomeClass' % __name__, spec_set=True)
732 @patch.object(support, 'SomeClass', spec_set=True)
740 @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))
1407 patcher = patch.multiple(Foo, foo=DEFAULT, spec_set=['a', 'b'])
1731 p = patch(MODNAME, spec_set=0, **{kwarg: 0})
1742 p = patch(MODNAME, spec=False, spec_set=False, autospec=False)
[all …]
Dtestmagicmethods.py384 mock = Mock(spec_set=Iterable)
392 mock = Mock(spec_set=NonIterable)
399 mock = MagicMock(spec_set=Iterable)
Dtesthelpers.py530 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.py728 @patch('%s.SomeClass' % __name__, spec=SomeClass, spec_set=True)
734 @patch.object(support, 'SomeClass', spec=SomeClass, spec_set=True)
739 @patch('%s.SomeClass' % __name__, spec_set=True)
745 @patch.object(support, 'SomeClass', spec_set=True)
753 @patch('%s.SomeClass' % __name__, spec_set=True)
1132 patcher = patch(foo_name, new_callable=Bar, spec_set=Bar)
1135 self.assertEqual(Bar.kwargs, dict(spec_set=Bar))
1426 patcher = patch.multiple(Foo, foo=DEFAULT, spec_set=['a', 'b'])
1750 p = patch(MODNAME, spec_set=0, **{kwarg: 0})
1761 p = patch(MODNAME, spec=False, spec_set=False, autospec=False)
[all …]
Dtestmagicmethods.py321 mock = Mock(spec_set=Iterable)
329 mock = Mock(spec_set=NonIterable)
336 mock = MagicMock(spec_set=Iterable)
Dtestmock.py111 mock = Mock(spec_set=X)
114 mock = Mock(spec_set=X())
760 mock = Mock(spec_set=X)
763 mock = Mock(spec_set=X())
774 mock = Mock(spec_set=X)
800 s = SubClass(spec_set=SubClass)
1495 klasses.append(lambda K=Klass: K(spec_set=Anything))
1498 for kwargs in dict(), dict(spec_set=True):
1504 for kwargs in dict(), dict(spec_set=True):
Dtesthelpers.py549 mock = create_autospec(spec, spec_set=True)
/external/python/cpython3/Doc/library/
Dunittest.mock.rst204 .. class:: Mock(spec=None, side_effect=None, return_value=DEFAULT, wraps=None, name=None, spec_set=…
219 * *spec_set*: A stricter variant of *spec*. If used, attempting to *set*
221 *spec_set* will raise an :exc:`AttributeError`.
398 .. method:: mock_add_spec(spec, spec_set=False)
404 If *spec_set* is true then only attributes on the spec can be set.
716 .. class:: NonCallableMock(spec=None, wraps=None, name=None, spec_set=None, **kwargs)
723 :attr:`spec_set` are able to pass :func:`isinstance` tests:
728 >>> mock = Mock(spec_set=SomeClass())
761 A callable mock which was created with a *spec* (or a *spec_set*) will
1058 .. function:: patch(target, new=DEFAULT, spec=None, create=False, spec_set=None, autospec=None, new…
[all …]
Dunittest.mock-examples.rst305 *spec_set* instead of *spec*.
947 (or *spec_set*) argument so that the ``MagicMock`` created only has
950 >>> mock = MagicMock(spec_set=dict)
/external/python/cpython3/Lib/test/test_asyncio/
Dtest_unix_events.py636 self.pipe = mock.Mock(spec_set=io.RawIOBase)
786 self.pipe = mock.Mock(spec_set=io.RawIOBase)
Dtest_selector_events.py1466 self.sock = mock.Mock(spec_set=socket.socket)