File: test_invalid_chars.py

package info (click to toggle)
python3-proselint 0.14.0-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 1,220 kB
  • sloc: python: 7,173; sh: 6; makefile: 3
file content (26 lines) | stat: -rw-r--r-- 681 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
"""Check that the CLI can handle invalid characters."""

from pathlib import Path

from click.testing import CliRunner

from proselint.command_line import proselint

from .check import Check

CHAR_FILE = Path(__file__, "../invalid-chars.txt").resolve()


class TestInvalidCharacters(Check):
    """Test class for testing invalid characters on the CLI"""

    __test__ = True

    def test_invalid_characters(self):
        """Ensure that invalid characters do not break proselint."""
        runner = CliRunner()

        output = runner.invoke(proselint, CHAR_FILE)

        assert "UnicodeDecodeError" not in output.stdout
        assert "FileNotFoundError" not in output.stdout