-
-
Notifications
You must be signed in to change notification settings - Fork 36
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
29 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
import testify as T | ||
|
||
from git_code_debt.file_diff_stat import FileDiffStat | ||
from git_code_debt.metric import Metric | ||
from git_code_debt.metrics.curse import CurseWordsParser | ||
from testing.base_classes.test import test | ||
|
||
|
||
@test | ||
def test_curse_words_parser(): | ||
parser = CurseWordsParser() | ||
input = [ | ||
FileDiffStat( | ||
'templates/foo.tmpl', | ||
['#man seriously, fuck cheetah'], | ||
[], | ||
None, | ||
), | ||
FileDiffStat( | ||
'cmds/foo.py', | ||
["# I'm clean I swear"], | ||
[], | ||
None, | ||
), | ||
] | ||
metrics = list(parser.get_metrics_from_stat(input)) | ||
T.assert_in(Metric('TotalCurseWords_Template', 1), metrics) | ||
T.assert_in(Metric('TotalCurseWords_Python', 0), metrics) | ||
|