From fe4ea0b6d0e7054ad22358027a7b6ef8abf887a8 Mon Sep 17 00:00:00 2001 From: Josh Grant Date: Thu, 14 Jul 2016 17:02:42 -0400 Subject: [PATCH] added test case for tools.consistency_check --- tests/test_consistency_check.py | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 tests/test_consistency_check.py diff --git a/tests/test_consistency_check.py b/tests/test_consistency_check.py new file mode 100644 index 000000000..f1952129e --- /dev/null +++ b/tests/test_consistency_check.py @@ -0,0 +1,32 @@ +"""Test the consistency_check function from the tools.py module.""" +from __future__ import absolute_import + +from .check import Check + +from proselint.tools import consistency_check as chk + + +class TestCheck(Check): + """The test class for tools.consistency_check.""" + + __test__ = True + + @property + def this_check(self): + """Bolierplate.""" + return chk + + def setUp(self): + """Create some test fixtures.""" + self.l = [['colour', 'color']] + self.err = 'error message' + self.msg = 'inconsistent form of {} vs {}' + + 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) == []