Lines Matching refs:MagicMock
3 from unittest.mock import Mock, MagicMock, _magics
21 mock = MagicMock()
26 mock = MagicMock()
183 self.assertRaises(TypeError, lambda: MagicMock() < object())
184 self.assertRaises(TypeError, lambda: object() < MagicMock())
185 self.assertRaises(TypeError, lambda: MagicMock() < MagicMock())
186 self.assertRaises(TypeError, lambda: MagicMock() > object())
187 self.assertRaises(TypeError, lambda: object() > MagicMock())
188 self.assertRaises(TypeError, lambda: MagicMock() > MagicMock())
189 self.assertRaises(TypeError, lambda: MagicMock() <= object())
190 self.assertRaises(TypeError, lambda: object() <= MagicMock())
191 self.assertRaises(TypeError, lambda: MagicMock() <= MagicMock())
192 self.assertRaises(TypeError, lambda: MagicMock() >= object())
193 self.assertRaises(TypeError, lambda: object() >= MagicMock())
194 self.assertRaises(TypeError, lambda: MagicMock() >= MagicMock())
198 for mock in Mock(), MagicMock():
218 mock = MagicMock()
247 mock = MagicMock()
262 mock = MagicMock()
273 mock = MagicMock()
311 mock = MagicMock(spec=Iterable)
336 mock = MagicMock(spec_set=Iterable)
342 mock = MagicMock()
352 mock = MagicMock()
358 self.assertEqual(_get_type(attr), MagicMock)
361 self.assertEqual(_get_type(returned), MagicMock)
365 mock = MagicMock()
366 self.assertIsInstance(mock.__getitem__, MagicMock)
373 mock = MagicMock()
382 for mock in Mock(), MagicMock():
402 class Foo(MagicMock):
410 m = MagicMock()
416 m = MagicMock()
427 m = MagicMock()
428 self.assertIsInstance(m @ 1, MagicMock)
438 m = MagicMock()
439 self.assertIsInstance(divmod(5, m), MagicMock)
442 m = MagicMock()
444 self.assertIsInstance(foo, MagicMock)
446 self.assertIsInstance(foo_direct, MagicMock)
448 self.assertIsInstance(bar, MagicMock)
450 self.assertIsInstance(bar_direct, MagicMock)
455 m = MagicMock(**{'__str__.return_value': "12"})
459 m = MagicMock(**{'__str__.return_value': "12"})
462 m = MagicMock(**{'__str__.return_value': "12"})