def test_findAllExceptions(self):
        """
        Test for twistedchecker.core.exceptionfinder.test_findAllExceptions.
        """
        pathTestFiles = createTestFiles(self.mktemp())
        patternsFunc, patternsClass = findAllExceptions(pathTestFiles)

        self.assertEqual(patternsFunc, {"foo_", "baz_"})
        self.assertEqual(patternsClass, {"Bar_"})
Пример #2
0
    def test_findAllExceptions(self):
        """
        Test for twistedchecker.core.exceptionfinder.test_findAllExceptions.
        """
        pathTestFiles = createTestFiles(self.mktemp())
        patternsFunc, patternsClass = findAllExceptions(pathTestFiles)

        self.assertEqual(patternsFunc, {"foo_", "baz_"})
        self.assertEqual(patternsClass, {"Bar_"})
Пример #3
0
    def setNameExceptions(self, filesOrModules):
        """
        Find name exceptions in codes and allow them to be ignored
        in checking.

        @param filesOrModules: a list of modules (may be foo/bar.py or
        foo.bar)
        """
        pathList = self.getPathList(filesOrModules)
        for path in pathList:
            patternsFunc, patternsClass = findAllExceptions(path)
            self.allowPatternsForNameChecking(patternsFunc, patternsClass)
Пример #4
0
    def setNameExceptions(self, filesOrModules):
        """
        Find name exceptions in codes and allow them to be ignored
        in checking.

        @param filesOrModules: a list of modules (may be foo/bar.py or
        foo.bar)
        """
        pathList = self.getPathList(filesOrModules)
        for path in pathList:
            patternsFunc, patternsClass = findAllExceptions(path)
            self.allowPatternsForNameChecking(patternsFunc, patternsClass)