Lines Matching refs:Mock
12 MagicMock, Mock, NonCallableMock,
54 mock = Mock()
59 self.assertTrue(is_instance(mock.return_value, Mock),
82 mock = Mock(return_value=None)
103 mock = Mock(name='foo')
107 mocks = [(Mock(), 'mock'), (Mock(name='bar'), 'bar')]
122 mock = Mock(spec=X)
125 mock = Mock(spec=X())
128 mock = Mock(spec_set=X)
131 mock = Mock(spec_set=X())
134 mock = Mock(spec=X, name='foo')
138 mock = Mock(name='foo')
141 mock = Mock()
144 mock = Mock(spec=['foo'])
149 mock = Mock()
166 mock = Mock(side_effect=sentinel.SideEffect)
172 mock = Mock(side_effect=side_effect, return_value=sentinel.RETURN)
203 parent = Mock()
205 mock = Mock(name="child", parent=parent, spec=spec)
244 mock = Mock()
255 mock = Mock()
256 self.assertTrue(is_instance(mock.return_value, Mock),
293 mock = Mock()
343 mock = Mock()
366 mock = Mock(spec=f)
387 mock = Mock(spec=Something().meth)
389 mock = Mock(spec=Something.cmeth)
391 mock = Mock(spec=Something().cmeth)
393 mock = Mock(spec=Something.smeth)
395 mock = Mock(spec=Something().smeth)
402 Mock().assert_called()
404 Mock(name="test_name").assert_called()
408 mock = Mock()
431 m = Mock()
442 mock = Mock(spec=f)
462 mock = Mock()
464 self.assertTrue(is_instance(something, Mock), "attribute isn't a mock")
469 mock = Mock()
478 mock = Mock()
488 mock = Mock()
503 mock = Mock()
508 mock = Mock()
514 mock = Mock()
519 mock = Mock()
529 mock = Mock(**{arg: spec})
562 test_attributes(Mock(spec=Something))
563 test_attributes(Mock(spec=Something()))
567 real = Mock()
569 mock = Mock(wraps=real)
583 mock = Mock(wraps=real)
589 real = Mock()
591 mock = Mock(wraps=real)
600 attribute = Mock()
604 mock = Mock(wraps=real)
620 mock = Mock(wraps=real)
633 mock = Mock(wraps=real)
646 mock = Mock(wraps=real)
659 mock = Mock(wraps=real)
670 mock = Mock(wraps=real)
682 mock = Mock(wraps=real)
697 mock = Mock(wraps=real)
709 mock = Mock(wraps=real)
770 mock = Mock(side_effect=AttributeError)
773 mock = Mock(side_effect=AttributeError('foo'))
778 mock = Mock(side_effect=KeyboardInterrupt)
781 mock = Mock(side_effect=KeyboardInterrupt('foo'))
786 mock = Mock()
792 mock = Mock(name='geoffrey')
799 mock = Mock()
809 mock = Mock(spec=Sub(['foo']))
820 mock = Mock(spec=X)
823 mock = Mock(spec=X())
827 self.assertEqual(Mock().__class__.__name__, 'Mock')
829 mock = Mock(spec_set=X)
832 mock = Mock(spec_set=X())
840 mock = Mock(spec=X)
843 mock = Mock(spec=X())
847 self.assertEqual(Mock().__class__.__name__, 'Mock')
849 mock = Mock(spec_set=X)
852 mock = Mock(spec_set=X())
860 mock = Mock(spec=X)
863 mock = Mock(spec_set=X)
878 copy.copy(Mock())
882 class SubClass(Mock):
902 mock = Mock()
915 mock = Mock()
917 type_attrs = set([m for m in dir(Mock) if not m.startswith('_')])
938 mock = Mock(spec=unittest.TestCase)
954 attrs = set(dir(Mock()))
955 type_attrs = set(dir(Mock))
964 mock = Mock()
973 mock = Mock(foo='bar')
981 mock = Mock(**kwargs)
986 mock = Mock()
1136 m = Mock()
1146 m = Mock()
1153 m = Mock()
1160 m = Mock()
1167 m = Mock()
1173 m = Mock()
1179 m = Mock()
1187 m = Mock()
1194 m = Mock()
1199 class Subclass(Mock):
1206 class Subclass(Mock):
1208 return Mock(**kwargs)
1217 Mock(),
1251 mock = Mock()
1267 mock = Mock(side_effect=iter([1, 2, 3]))
1275 mock = Mock(side_effect='ghi')
1284 mock = Mock(side_effect=Iter())
1291 for Klass in Mock, MagicMock:
1301 mock = Mock()
1322 mock = Mock(return_value=2)
1327 mock = Mock()
1381 for mock in Mock(), MagicMock():
1389 mock = Mock()
1461 mock = Mock(spec=f)
1492 mock = Mock(spec=f)
1517 mock = Mock()
1545 mock = Mock(spec=f)
1600 m = Mock()
1606 m = Mock(unsafe=True)
1612 m = Mock()
1619 m = Mock()
1626 m = Mock()
1636 m = Mock()
1647 m = Mock()
1655 m = Mock()
1662 m = Mock()
1671 m = Mock()
1678 m = Mock(return_value=10, side_effect=[2,3])
1680 self.assertIsInstance(m.return_value, Mock)
1684 m = Mock(return_value=10, side_effect=[2,3])
1686 self.assertIsInstance(m.return_value, Mock)
1690 m = Mock(return_value=10, side_effect=[2, 3])
1716 Mock, MagicMock, NonCallableMock, NonCallableMagicMock
1778 for Klass in (NonCallableMock, Mock, MagicMock, NonCallableMagicMock,
1782 mock.foo = Mock()
1789 mock.bar = Mock(name='name')
1803 for Klass in Mock, MagicMock:
1815 manager = Mock()
1834 for Klass in Mock, MagicMock:
1836 m.__int__ = Mock(return_value=3)
1912 for Klass in Mock, MagicMock:
1941 classes = Mock, MagicMock, NonCallableMagicMock, NonCallableMock
1958 classes = Mock, MagicMock, NonCallableMagicMock, NonCallableMock
1959 for Klass in Mock, MagicMock:
1974 parent = Mock()
1995 manager = Mock()
2004 manager = Mock()
2012 manager = Mock()
2023 for mock in (Mock(), MagicMock(), NonCallableMagicMock(),
2037 for mock in (Mock(), MagicMock(), NonCallableMagicMock(),
2055 for mock in (Mock(), MagicMock(), NonCallableMagicMock(),
2065 mock = Mock()
2073 for mock in Mock(), MagicMock():
2099 mock = Mock()
2111 parent = Mock()
2148 Mock, MagicMock, NonCallableMock, NonCallableMagicMock
2152 Mock, MagicMock, NonCallableMock, NonCallableMagicMock, AsyncMock