-
Notifications
You must be signed in to change notification settings - Fork 178
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Create a test to ensure great samples are clean
- Loading branch information
Showing
5 changed files
with
22 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -16,7 +16,6 @@ | |
""" | ||
from proselint.reverse import reverse | ||
|
||
|
||
def check(text): | ||
|
||
reversed_text = reverse(text) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
The quick brown fox jumps over the lazy dog. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
import os | ||
import subprocess | ||
|
||
|
||
class TestSamples(object): | ||
|
||
def test_samples(self): | ||
examples_dir = os.path.join(os.getcwd(), "tests", "samples") | ||
examples = os.listdir(examples_dir) | ||
|
||
for example in examples: | ||
example_path = os.path.join(examples_dir, example) | ||
out = subprocess.check_output( | ||
"proselint " + example_path, | ||
shell=True) | ||
|
||
num_errors = out.count("\n") | ||
|
||
assert num_errors == 0, \ | ||
"{} produced {} errors.".format(example, num_errors) |