File: test_a_A.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 (56 lines) | stat: -rw-r--r-- 2,295 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
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
#!/usr/bin/env python

"""Test GMEU entry 'a', part A."""


from proselint.tools import assert_error

from tests.check import Check


class chk:
    def check(self, text):
        return assert_error, text, "misc.a_vs_an"


class TestCheck(Check):
    """The test class for GMEU entry A - using the correct determiner."""

    @property
    def this_check(self):
        return chk

    sentences_with_errors = [
        "Are you an Yankee fan?",
        "Coffee tastes less sweet in an white mug.",
        "One of them wore a opalescent vest.",
        "You're a intelligent guy, often misguided.",
        "Ezra gave an eulogy.",
        "What capital of an European country is the farthest north?",
        "His sole reward was an one-year term as Ambassador to Thailand.",
        "I will be relying on a roulette wheel and an Ouija board.",
        "Anyone in an uniform is fair game.",
        "Grimm started working as a F.B.I. agent in 1995.",
        "Out of 186 managers participating, 57 had a MBA degree.",
        "Smith announced that a SEC filing is pending.",
        "This argument is an historical desecration.",
        "The treatment of crime in Britain shows an historic shift away…",
        "It is, in some ways, an humble form.",
        "The thief turned out to be an habitual offender from Darlington.",
        "This stage displays an hallucinatory image that signifies itself.",
        "He saw an hallucinatory image before passing out.",
        "A triumphant Adolf Hitler addressed an hysterical crowd.",
        "Kun pieced together an history of gender-segregated dining in L.A.",
        "An historian who fled the Nazis and still wants us to read Hitler.",
        "It is nominally an historical novel.",
        "It feels good to validate an hypothesis.",
        "An hereditary title can be passed to a member of the family.",
        "The Clinton Presidency was an historic era of prosperity.",
        "There comes to be an habitual pattern between neurons in the brain.",
        "They had the authority to start an humanitarian intervention.",
        "She laughed aloud, an hysterical sort of giggled, quickly stifled",
    ]

    def test_smoke(self):
        for sentence in self.sentences_with_errors:
            assert not self.passes(sentence)