-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Helper function for dealing with names while avoiding pesky things like quoting, spaces, and case sensitivity
- Loading branch information
Showing
2 changed files
with
42 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,21 @@ | ||
#!/usr/bin/env python | ||
|
||
""" Tests for the nym function from strutil module """ | ||
|
||
from toolchest.strutil import nym | ||
|
||
|
||
def test_identity(): | ||
assert nym('abc') == 'abc' | ||
|
||
|
||
def test_spaces(): | ||
assert nym('abc def') == 'abc_def' | ||
|
||
|
||
def test_tabs(): | ||
assert nym('abc\tdef') == 'abc_def' | ||
|
||
|
||
def test_lowercase(): | ||
assert nym('aBcDeF') == 'abcdef' |
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