예제 #1
0
    def test_check_symbols_archive_content(self):
        content = """
        HEADER 1
        HEADER 2
        Line 1
        Line Two
        Line Three
        """

        # check that the header is not checked
        disallowed = ('HEADER', )
        with self.settings(DISALLOWED_SYMBOLS_SNIPPETS=disallowed):
            error = check_symbols_archive_content(content.strip())
            ok_(not error)

        # match something
        disallowed = ('Two', '2')
        with self.settings(DISALLOWED_SYMBOLS_SNIPPETS=disallowed):
            error = check_symbols_archive_content(content.strip())
            ok_(error)
            ok_('Two' in error)

        # match nothing
        disallowed = ('evil', 'Bad')
        with self.settings(DISALLOWED_SYMBOLS_SNIPPETS=disallowed):
            error = check_symbols_archive_content(content.strip())
            ok_(not error)
예제 #2
0
    def test_check_symbols_archive_content(self):
        content = """
        HEADER 1
        HEADER 2
        Line 1
        Line Two
        Line Three
        """

        # check that the header is not checked
        disallowed = ('HEADER',)
        with self.settings(DISALLOWED_SYMBOLS_SNIPPETS=disallowed):
            error = check_symbols_archive_content(content.strip())
            ok_(not error)

        # match something
        disallowed = ('Two', '2')
        with self.settings(DISALLOWED_SYMBOLS_SNIPPETS=disallowed):
            error = check_symbols_archive_content(content.strip())
            ok_(error)
            ok_('Two' in error)

        # match nothing
        disallowed = ('evil', 'Bad')
        with self.settings(DISALLOWED_SYMBOLS_SNIPPETS=disallowed):
            error = check_symbols_archive_content(content.strip())
            ok_(not error)
예제 #3
0
    def test_check_symbols_archive_content(self):
        content = """
        Line 1
        Line Two
        Line Three
        """

        # match something
        disallowed = ('Two', '2')
        with self.settings(DISALLOWED_SYMBOLS_SNIPPETS=disallowed):
            error = check_symbols_archive_content(content.strip())
            assert error
            assert 'Two' in error

        # match nothing
        disallowed = ('evil', 'Bad')
        with self.settings(DISALLOWED_SYMBOLS_SNIPPETS=disallowed):
            error = check_symbols_archive_content(content.strip())
            assert not error