Check that the test case is complete : each interface entry xxx must be associated to a test_xxx method in the test class.
00088 : """ Check that the test case is complete : each interface entry xxx must be associated to a test_xxx method in the test class. """ not_defined =  tests = dir(self) count = 0 # Check interface for each and every class ignore = getattr(self, "ignore_interfaces", ) for klass in self.klasses: intfs = getattr(klass, "__implements__", None) self.failUnless(intfs, "'%s' class doesn't implement an interface!" % (klass.__name__, )) # Flatten interfaces intfs = flattenInterfaces(intfs) # Check each and every interface for intf in intfs: if intf in ignore: continue for name in intf.names(): count += 1 if not "test_%s" % (name,) in tests: not_defined.append("%s.%s" % (klass.__name__, name)) # Raise in case some tests are missing if not_defined: raise RuntimeError, "%d (over %d) MISSING TESTS:\n%s do not have a test associated." % ( len(not_defined), count, string.join(not_defined, ", "), ) def test03ClassSecurityInfo(self):