def test_capitalization(self):
     """Test for preferred forms involving capitalization."""
     raise SkipTest
     assert chk(
         """"I live in canada""", self.l_caps, self.err, self.msg) != []
     assert chk(
         """"I live in Canada""", self.l_caps, self.err, self.msg) == []
Exemplo n.º 2
0
 def test_smoke(self):
     """Basic smoke test for consistency_check."""
     assert chk("Painting colour on color", self.l, self.err,
                self.msg) != []
     assert chk("Painting colour on colour", self.l, self.err,
                self.msg) == []
     assert chk("Painting color on color", self.l, self.err, self.msg) == []
 def test_smoke(self):
     """Basic smoke test for preferred_forms_check."""
     raise SkipTest
     assert chk(
         """We utilize this tech""", self.l, self.err, self.msg) != []
     assert chk(
         """We use this tech""", self.l, self.err, self.msg) == []
 def test_capitalization(self):
     """Test for preferred forms involving capitalization."""
     assert not chk(
         "In the stone age", self.l_caps, self.err, self.msg,
         ignore_case=False)
     assert chk(
         "In the Stone Age", self.l_caps, self.err, self.msg,
         ignore_case=False) == []
 def test_smoke(self):
     """Basic smoke test for consistency_check."""
     assert chk(
         "Painting colour on color", self.l, self.err, self.msg) != []
     assert chk(
         "Painting colour on colour", self.l, self.err, self.msg) == []
     assert chk(
         "Painting color on color", self.l, self.err, self.msg) == []
Exemplo n.º 6
0
 def test_smoke(self):
     """Basic smoke test to determine that existence_check is working."""
     assert chk("""abc is as easy as 123""", self.L, self.err,
                self.msg) != []
     assert chk("""easy breezy""", self.L, self.err, self.msg) == []
     assert self.err in chk("""abc is as easy as 123""", self.L, self.err,
                            self.msg)[0]
     assert self.msg in chk("""abc is as easy as 123""", self.L, self.err,
                            self.msg)[0]
Exemplo n.º 7
0
 def test_multiple_matches(self):
     """Test that multiple matches are found correctly."""
     assert len(
         chk("""abc and abc are as easy as 123""",
             self.l, self.err, self.msg)) == 2
     assert len(
         chk("""ABC and abc are as easy as 123""",
             self.l, self.err, self.msg, ignore_case=True)) == 2
     assert chk(
         """abcabc are easy as 123""", self.l, self.err, self.msg) == []
Exemplo n.º 8
0
 def test_smoke(self):
     """Basic smoke test to determine that existence_check is working."""
     assert chk(
         """abc is as easy as 123""", self.l, self.err, self.msg) != []
     assert chk(
         """easy breezy""", self.l, self.err, self.msg) == []
     assert self.err in chk(
         """abc is as easy as 123""", self.l, self.err, self.msg)[0]
     assert self.msg in chk(
         """abc is as easy as 123""", self.l, self.err, self.msg)[0]
 def test_capitalization(self):
     """Test for preferred forms involving capitalization."""
     assert not chk("In the stone age",
                    self.l_caps,
                    self.err,
                    self.msg,
                    ignore_case=False)
     assert chk("In the Stone Age",
                self.l_caps,
                self.err,
                self.msg,
                ignore_case=False) == []
Exemplo n.º 10
0
 def test_exceptions(self):
     """Test that existence_check does not report excluded phrases"""
     regex = [r"\b(\w+)\b\s\1"]
     no = ["should should"]
     errs = chk("should should flag flag.",
                regex,
                "",
                "",
                require_padding=False)
     assert len(errs) == 2
     errs = chk("should should flag flag.",
                regex,
                "",
                "",
                exceptions=no,
                require_padding=False)
     assert len(errs) == 1
Exemplo n.º 11
0
 def test_string_types(self):
     """Test that the function works with different string types."""
     assert chk('abc is easy as 123', self.l, self.err, self.msg) != []
     assert chk("abc is easy as 123", self.l, self.err, self.msg) != []
     assert chk(u'abc is easy as 123', self.l, self.err, self.msg) != []
     assert chk(u"abc is easy as 123", self.l, self.err, self.msg) != []
 def test_smoke(self):
     """Basic smoke test for preferred_forms_check."""
     assert chk("We utilize this tech", self.L, self.err, self.msg) != []
     assert chk("We use this tech", self.L, self.err, self.msg) == []