Lines Matching refs:Mock
12 MagicMock, Mock, NonCallableMock,
60 mock = Mock()
65 self.assertTrue(is_instance(mock.return_value, Mock),
88 mock = Mock(return_value=None)
109 mock = Mock(name='foo')
113 mocks = [(Mock(), 'mock'), (Mock(name='bar'), 'bar')]
128 mock = Mock(spec=X)
131 mock = Mock(spec=X())
134 mock = Mock(spec_set=X)
137 mock = Mock(spec_set=X())
140 mock = Mock(spec=X, name='foo')
144 mock = Mock(name='foo')
147 mock = Mock()
150 mock = Mock(spec=['foo'])
155 mock = Mock()
172 mock = Mock(side_effect=sentinel.SideEffect)
178 mock = Mock(side_effect=side_effect, return_value=sentinel.RETURN)
231 parent = Mock()
233 mock = Mock(name="child", parent=parent, spec=spec)
272 mock = Mock()
283 mock = Mock()
284 self.assertTrue(is_instance(mock.return_value, Mock),
321 mock = Mock()
371 mock = Mock()
394 mock = Mock(spec=f)
415 mock = Mock(spec=Something().meth)
417 mock = Mock(spec=Something.cmeth)
419 mock = Mock(spec=Something().cmeth)
421 mock = Mock(spec=Something.smeth)
423 mock = Mock(spec=Something().smeth)
430 Mock().assert_called()
432 Mock(name="test_name").assert_called()
436 mock = Mock()
459 m = Mock()
470 mock = Mock(spec=f)
490 mock = Mock()
492 self.assertTrue(is_instance(something, Mock), "attribute isn't a mock")
497 mock = Mock()
506 mock = Mock()
516 mock = Mock()
531 mock = Mock()
536 mock = Mock()
542 mock = Mock()
547 mock = Mock()
557 mock = Mock(**{arg: spec})
590 test_attributes(Mock(spec=Something))
591 test_attributes(Mock(spec=Something()))
595 real = Mock()
597 mock = Mock(wraps=real)
611 mock = Mock(wraps=real)
617 real = Mock()
619 mock = Mock(wraps=real)
628 attribute = Mock()
632 mock = Mock(wraps=real)
648 mock = Mock(wraps=real)
661 mock = Mock(wraps=real)
674 mock = Mock(wraps=real)
687 mock = Mock(wraps=real)
698 mock = Mock(wraps=real)
710 mock = Mock(wraps=real)
725 mock = Mock(wraps=real)
737 mock = Mock(wraps=real)
798 mock = Mock(side_effect=AttributeError)
801 mock = Mock(side_effect=AttributeError('foo'))
806 mock = Mock(side_effect=KeyboardInterrupt)
809 mock = Mock(side_effect=KeyboardInterrupt('foo'))
814 mock = Mock()
820 mock = Mock(name='geoffrey')
827 mock = Mock()
837 mock = Mock(spec=Sub(['foo']))
848 mock = Mock(spec=X)
851 mock = Mock(spec=X())
855 self.assertEqual(Mock().__class__.__name__, 'Mock')
857 mock = Mock(spec_set=X)
860 mock = Mock(spec_set=X())
868 mock = Mock(spec=X)
871 mock = Mock(spec=X())
875 self.assertEqual(Mock().__class__.__name__, 'Mock')
877 mock = Mock(spec_set=X)
880 mock = Mock(spec_set=X())
888 mock = Mock(spec=X)
891 mock = Mock(spec_set=X)
906 copy.copy(Mock())
910 class SubClass(Mock):
930 mock = Mock()
943 mock = Mock()
945 type_attrs = set([m for m in dir(Mock) if not m.startswith('_')])
966 mock = Mock(spec=unittest.TestCase)
982 attrs = set(dir(Mock()))
983 type_attrs = set(dir(Mock))
992 mock = Mock()
1001 mock = Mock(foo='bar')
1009 mock = Mock(**kwargs)
1014 mock = Mock()
1164 m = Mock()
1174 m = Mock()
1181 m = Mock()
1188 m = Mock()
1195 m = Mock()
1201 m = Mock()
1207 m = Mock()
1215 m = Mock()
1222 m = Mock()
1227 class Subclass(Mock):
1234 class Subclass(Mock):
1236 return Mock(**kwargs)
1245 Mock(),
1279 mock = Mock()
1295 mock = Mock(side_effect=iter([1, 2, 3]))
1303 mock = Mock(side_effect='ghi')
1312 mock = Mock(side_effect=Iter())
1319 for Klass in Mock, MagicMock:
1329 mock = Mock()
1350 mock = Mock(return_value=2)
1355 mock = Mock()
1409 for mock in Mock(), MagicMock():
1417 mock = Mock()
1489 mock = Mock(spec=f)
1520 mock = Mock(spec=f)
1545 mock = Mock()
1573 mock = Mock(spec=f)
1628 m = Mock()
1640 m = Mock(unsafe=True)
1649 m = Mock()
1656 m = Mock()
1663 m = Mock()
1673 m = Mock()
1684 m = Mock()
1692 m = Mock()
1699 m = Mock()
1708 m = Mock()
1715 m = Mock(return_value=10, side_effect=[2,3])
1717 self.assertIsInstance(m.return_value, Mock)
1721 m = Mock(return_value=10, side_effect=[2,3])
1723 self.assertIsInstance(m.return_value, Mock)
1727 m = Mock(return_value=10, side_effect=[2, 3])
1753 Mock, MagicMock, NonCallableMock, NonCallableMagicMock
1815 for Klass in (NonCallableMock, Mock, MagicMock, NonCallableMagicMock,
1819 mock.foo = Mock()
1826 mock.bar = Mock(name='name')
1840 for Klass in Mock, MagicMock:
1852 manager = Mock()
1871 for Klass in Mock, MagicMock:
1873 m.__int__ = Mock(return_value=3)
1949 for Klass in Mock, MagicMock:
1978 classes = Mock, MagicMock, NonCallableMagicMock, NonCallableMock
1995 classes = Mock, MagicMock, NonCallableMagicMock, NonCallableMock
1996 for Klass in Mock, MagicMock:
2011 parent = Mock()
2032 manager = Mock()
2041 manager = Mock()
2049 manager = Mock()
2060 for mock in (Mock(), MagicMock(), NonCallableMagicMock(),
2074 for mock in (Mock(), MagicMock(), NonCallableMagicMock(),
2092 for mock in (Mock(), MagicMock(), NonCallableMagicMock(),
2102 mock = Mock()
2110 for mock in Mock(), MagicMock():
2136 mock = Mock()
2148 parent = Mock()
2185 Mock, MagicMock, NonCallableMock, NonCallableMagicMock
2189 Mock, MagicMock, NonCallableMock, NonCallableMagicMock, AsyncMock