Example #1
0
 def testIsDirectlyConstructableReturnsTrue(self):
     self.assertTrue(
         discover.IsDirectlyConstructable(ClassWithoutInitDefOne))
     self.assertTrue(
         discover.IsDirectlyConstructable(ClassWithoutInitDefTwo))
     self.assertTrue(
         discover.IsDirectlyConstructable(ClassWhoseInitOnlyHasSelf))
     self.assertTrue(
         discover.IsDirectlyConstructable(
             ClassWhoseInitWithDefaultArguments))
 def testKnowsAboutAllExpectationsInDirectory(self):
     expectations = self.getAllExpectationsInDirectory()
     for exp in expectations:
         full_name = exp.__module__ + '.' + exp.__name__
         if full_name not in self._known_expectations:
             self.fail('Unknown expectation class ' + exp.__module__ + '.' +
                       exp.__name__)
         if not discover.IsDirectlyConstructable(exp):
             self.fail('Expectation class ' + exp.__module__ + '.' +
                       exp.__name__ +
                       ' must be directly constructible (no required args)')
Example #3
0
 def testIsDirectlyConstructableReturnsFalse(self):
     self.assertFalse(
         discover.IsDirectlyConstructable(
             ClassWhoseInitWithDefaultArgumentsAndNonDefaultArguments))