• Home
  • Raw
  • Download

Lines Matching refs:SomeClass

10 from unittest.test.testmock.support import SomeClass, is_instance
203 self.assertEqual(PTModule.SomeClass.class_attribute,
207 self.assertIsNone(PTModule.SomeClass.class_attribute,
254 @patch('%s.SomeClass' % __name__, spec=SomeClass)
256 self.assertEqual(SomeClass, MockSomeClass)
257 self.assertTrue(is_instance(SomeClass.wibble, MagicMock))
258 self.assertRaises(AttributeError, lambda: SomeClass.not_wibble)
264 @patch.object(SomeClass, 'class_attribute', spec=SomeClass)
266 self.assertEqual(SomeClass.class_attribute, MockAttribute)
267 self.assertTrue(is_instance(SomeClass.class_attribute.wibble,
270 lambda: SomeClass.class_attribute.not_wibble)
278 self.assertEqual(SomeClass, MockSomeClass)
279 self.assertTrue(is_instance(SomeClass.wibble, MagicMock))
280 self.assertRaises(AttributeError, lambda: SomeClass.not_wibble)
286 @patch.object(SomeClass, 'class_attribute', spec=['wibble'])
288 self.assertEqual(SomeClass.class_attribute, MockAttribute)
289 self.assertTrue(is_instance(SomeClass.class_attribute.wibble,
292 lambda: SomeClass.class_attribute.not_wibble)
302 self.assertEqual(SomeClass, MockSomeClass)
303 self.assertTrue(is_instance(SomeClass.wibble, MagicMock))
304 self.assertRaises(AttributeError, lambda: SomeClass.not_wibble)
311 self.assertEqual(SomeClass, MockSomeClass)
323 self.assertEqual(SomeClass, MockSomeClass)
356 @patch.object(SomeClass, 'frooble', sentinel.Frooble, create=True)
358 self.assertEqual(SomeClass.frooble, sentinel.Frooble)
361 self.assertFalse(hasattr(SomeClass, 'frooble'))
381 @patch.object(SomeClass, 'ord', sentinel.Frooble)
390 self.assertFalse(hasattr(SomeClass, 'ord'))
635 @patch.object(SomeClass, object())
728 @patch('%s.SomeClass' % __name__, spec=SomeClass, spec_set=True)
734 @patch.object(support, 'SomeClass', spec=SomeClass, spec_set=True)
1218 test.assertIsInstance(Foo, SomeClass)
1225 SomeTest = patch(foo_name, new_callable=SomeClass)(SomeTest)
1647 repr(m.SomeClass.wibble()))
1649 repr(m.SomeClass().wibble()))