Skip to content

Commit

Permalink
added more tests for coverage (amperser#584)
Browse files Browse the repository at this point in the history
  • Loading branch information
joshmgrant authored and suchow committed Aug 10, 2016
1 parent 190fbf0 commit a722420
Show file tree
Hide file tree
Showing 6 changed files with 118 additions and 1 deletion.
2 changes: 1 addition & 1 deletion proselint/checks/corporate_speak/misc.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@


@memoize
def check_repeated_exclamations(text):
def check(text):
"""Check the text."""
err = "corporate_speak.misc"
msg = u"Minimize your use of corporate catchphrases like this one."
Expand Down
23 changes: 23 additions & 0 deletions tests/test_annotations.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
"""Tests for annotations.misc check."""
from __future__ import absolute_import

from .check import Check

from proselint.checks.annotations import misc as chk


class TestCheck(Check):
"""The test class for annotations.misc."""

__test__ = True

@property
def this_check(self):
"""Bolierplate."""
return chk

def test_smoke(self):
"""Basic smoke test for annotations.misc."""
assert self.passes("""Smoke phrase with nothing flagged.""")
assert self.passes("""Add it to the to do list.""")
assert not self.passes("""Add it to the TODO list.""")
23 changes: 23 additions & 0 deletions tests/test_archaism.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
"""Tests for archaism.misc check."""
from __future__ import absolute_import

from .check import Check

from proselint.checks.archaism import misc as chk


class TestCheck(Check):
"""The test class for archaism.misc."""

__test__ = True

@property
def this_check(self):
"""Bolierplate."""
return chk

def test_smoke(self):
"""Basic smoke test for archaism.misc."""
assert self.passes("""Smoke phrase with nothing flagged.""")
assert self.passes("""I want to sleep, and maybe dream.""")
assert not self.passes("""I want to sleep, perchance to dream.""")
24 changes: 24 additions & 0 deletions tests/test_consistency_spacing.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
"""Tests for consistency.spacing check."""
from __future__ import absolute_import

from .check import Check

from proselint.checks.consistency import spacing as chk


class TestCheck(Check):
"""The test class for consistency.spacing."""

__test__ = True

@property
def this_check(self):
"""Bolierplate."""
return chk

def test_smoke(self):
"""Basic smoke test for consistency.spacing."""
assert self.passes("""Smoke phrase with nothing flagged.""")
assert self.passes(
"""This is good. Only one space each time. Every time.""")
assert not self.passes("""This is bad. Not consistent. At all.""")
24 changes: 24 additions & 0 deletions tests/test_consistency_spelling.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
"""Tests for consistency.spelling check."""
from __future__ import absolute_import

from .check import Check

from proselint.checks.consistency import spelling as chk


class TestCheck(Check):
"""The test class for consistency.spelling."""

__test__ = True

@property
def this_check(self):
"""Bolierplate."""
return chk

def test_smoke(self):
"""Basic smoke test for consistency.spelling."""
assert self.passes("""Smoke phrase with nothing flagged.""")
assert self.passes("""The centre for the arts is the art centre.""")
assert self.passes("""The center for the arts is the art center.""")
assert not self.passes("""The centre of the arts is the art center.""")
23 changes: 23 additions & 0 deletions tests/test_corporate_speak.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
"""Tests for corporate_speak.misc check."""
from __future__ import absolute_import

from .check import Check

from proselint.checks.corporate_speak import misc as chk


class TestCheck(Check):
"""The test class for corporate_speak.misc."""

__test__ = True

@property
def this_check(self):
"""Bolierplate."""
return chk

def test_smoke(self):
"""Basic smoke test for corporate_speak.misc."""
assert self.passes("""Smoke phrase with nothing flagged.""")
assert self.passes("""We will discuss it later.""")
assert not self.passes("""We will circle back around to it.""")

0 comments on commit a722420

Please sign in to comment.