Lines Matching refs:MagicMock
5 from unittest.mock import AsyncMock, Mock, MagicMock, _magics
23 mock = MagicMock()
28 mock = MagicMock()
185 self.assertRaises(TypeError, lambda: MagicMock() < object())
186 self.assertRaises(TypeError, lambda: object() < MagicMock())
187 self.assertRaises(TypeError, lambda: MagicMock() < MagicMock())
188 self.assertRaises(TypeError, lambda: MagicMock() > object())
189 self.assertRaises(TypeError, lambda: object() > MagicMock())
190 self.assertRaises(TypeError, lambda: MagicMock() > MagicMock())
191 self.assertRaises(TypeError, lambda: MagicMock() <= object())
192 self.assertRaises(TypeError, lambda: object() <= MagicMock())
193 self.assertRaises(TypeError, lambda: MagicMock() <= MagicMock())
194 self.assertRaises(TypeError, lambda: MagicMock() >= object())
195 self.assertRaises(TypeError, lambda: object() >= MagicMock())
196 self.assertRaises(TypeError, lambda: MagicMock() >= MagicMock())
200 for mock in Mock(), MagicMock():
220 mock = MagicMock()
249 mock = MagicMock()
264 mock = MagicMock()
300 mock = MagicMock()
327 mock = MagicMock()
354 mock = MagicMock(spec=Iterable)
378 mock = MagicMock(spec_set=Iterable)
384 mock = MagicMock()
394 mock = MagicMock()
400 self.assertEqual(_get_type(attr), MagicMock)
403 self.assertEqual(_get_type(returned), MagicMock)
407 mock = MagicMock()
408 self.assertIsInstance(mock.__getitem__, MagicMock)
415 mock = MagicMock()
424 for mock in Mock(), MagicMock():
443 class Foo(MagicMock):
451 m = MagicMock()
457 m = MagicMock()
468 m = MagicMock()
469 self.assertIsInstance(m @ 1, MagicMock)
479 m = MagicMock()
480 self.assertIsInstance(divmod(5, m), MagicMock)
483 m = MagicMock()
485 self.assertIsInstance(foo, MagicMock)
487 self.assertIsInstance(foo_direct, MagicMock)
489 self.assertIsInstance(bar, MagicMock)
491 self.assertIsInstance(bar_direct, MagicMock)
496 m = MagicMock(**{'__str__.return_value': "12"})
500 m = MagicMock(**{'__str__.return_value': "12"})
503 m = MagicMock(**{'__str__.return_value': "12"})