コード例 #1
0
    def test_should_skip_with_warning(self):
        """Test should_skip_with_warning()."""
        dispatcher = ProcessorDispatcher()

        # Check a non-skipped file.
        self.assertFalse(dispatcher.should_skip_with_warning("foo.txt"))

        # Check skipped files.
        paths_to_skip = [
            "gtk2drawing.c",
            "gtk2drawing.h",
            "JavaScriptCore/qt/api/qscriptengine_p.h",
            "WebCore/platform/gtk/gtk2drawing.c",
            "WebCore/platform/gtk/gtk2drawing.h",
            "WebKit/gtk/tests/testatk.c",
            "WebKit/qt/Api/qwebpage.h",
            "WebKit/qt/tests/qwebsecurityorigin/tst_qwebsecurityorigin.cpp",
        ]

        for path in paths_to_skip:
            self.assertTrue(dispatcher.should_skip_with_warning(path), "Checking: " + path)
コード例 #2
0
    def test_should_skip_with_warning(self):
        """Test should_skip_with_warning()."""
        dispatcher = ProcessorDispatcher()

        # Check a non-skipped file.
        self.assertFalse(dispatcher.should_skip_with_warning("foo.txt"))

        # Check skipped files.
        paths_to_skip = [
            "gtk2drawing.c",
            "gtk2drawing.h",
            "JavaScriptCore/qt/api/qscriptengine_p.h",
            "WebCore/platform/gtk/gtk2drawing.c",
            "WebCore/platform/gtk/gtk2drawing.h",
            "WebKit/gtk/tests/testatk.c",
            "WebKit/qt/Api/qwebpage.h",
            "WebKit/qt/tests/qwebsecurityorigin/tst_qwebsecurityorigin.cpp",
        ]

        for path in paths_to_skip:
            self.assertTrue(dispatcher.should_skip_with_warning(path),
                            "Checking: " + path)
コード例 #3
0
    def test_check_file_on_skip_with_warning(self):
        """Test check_file() for a skipped-with-warning file."""

        file_path = "gtk2drawing.c"

        dispatcher = ProcessorDispatcher()
        # Check that the input file is truly a skipped-with-warning file.
        self.assertTrue(dispatcher.should_skip_with_warning(file_path))

        # Check the outcome.
        self.call_check_file(file_path)
        self.assert_attributes(None, None, None,
                               'Ignoring "gtk2drawing.c": this file is exempt from the style guide.\n')
コード例 #4
0
    def test_check_file_on_skip_with_warning(self):
        """Test check_file() for a skipped-with-warning file."""

        file_path = "does_exist/gtk2drawing.c"

        dispatcher = ProcessorDispatcher()
        # Check that the input file is truly a skipped-with-warning file.
        self.assertTrue(dispatcher.should_skip_with_warning(file_path))

        # Check the outcome.
        self.call_check_file(file_path)
        self.assert_attributes(None, None, None, "")
        self.assertLog(["WARNING: File exempt from style guide. "
                        'Skipping: "does_exist/gtk2drawing.c"\n'])
コード例 #5
0
    def test_check_file_on_skip_with_warning(self):
        """Test check_file() for a skipped-with-warning file."""

        file_path = "gtk2drawing.c"

        dispatcher = ProcessorDispatcher()
        # Check that the input file is truly a skipped-with-warning file.
        self.assertTrue(dispatcher.should_skip_with_warning(file_path))

        # Check the outcome.
        self.call_check_file(file_path)
        self.assert_attributes(
            None, None, None,
            'Ignoring "gtk2drawing.c": this file is exempt from the style guide.\n'
        )