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_"})
Ejemplo n.º 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_"})
Ejemplo n.º 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)
Ejemplo n.º 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)