-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix sanitize_severity() maping "ok" -> "Ok" (not all caps)
- Loading branch information
Showing
3 changed files
with
42 additions
and
1 deletion.
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
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,33 @@ | ||
#!/usr/bin/env python3 | ||
|
||
from gnocpush.utils import sanitize_severity | ||
|
||
|
||
def test_critical(): | ||
words = ["critical", "CRITICAL", "cRiTiCaL", "Critical"] | ||
for word in words: | ||
assert sanitize_severity(word) == 'Critical' | ||
|
||
|
||
def test_major(): | ||
words = ["major", "MAJOR", "mAjOr", "Major"] | ||
for word in words: | ||
assert sanitize_severity(word) == 'Major' | ||
|
||
|
||
def test_minor(): | ||
words = ["minor", "MINOR", "mInOr", "Minor"] | ||
for word in words: | ||
assert sanitize_severity(word) == 'Minor' | ||
|
||
|
||
def test_unknown(): | ||
words = ["unknown", "UNKNOWN", "uNkNoWn", "Unknown", "foo", "bar", "baz"] | ||
for word in words: | ||
assert sanitize_severity(word) == 'Unknown' | ||
|
||
|
||
def test_ok(): | ||
words = ["ok", "OK", "oK", "Ok"] | ||
for word in words: | ||
assert sanitize_severity(word) == 'OK' |