-
Notifications
You must be signed in to change notification settings - Fork 1
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
1 parent
1b75f10
commit 19d02c3
Showing
4 changed files
with
41 additions
and
0 deletions.
There are no files selected for viewing
Empty file.
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,15 @@ | ||
import secsie | ||
|
||
|
||
|
||
def test_null(): | ||
""" | ||
Tests that secsie recognizes special values in config. | ||
""" | ||
config = secsie.parse_config( | ||
""" | ||
not-null = none # none is not converted to None in Python, 'null' is. | ||
""") | ||
|
||
assert config['not-null'] == 'none' | ||
|
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,8 @@ | ||
import re | ||
import secsie | ||
|
||
|
||
def test_secsie_semver_syntax(): | ||
VERSION_EX = re.compile(r'^(?P<major>0|[1-9]\d*)\.(?P<minor>0|[1-9]\d*)\.(?P<patch>0|[1-9]\d*)(?:-(?P<prerelease>(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\.(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\+(?P<buildmetadata>[0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?$') | ||
assert VERSION_EX.match(secsie.__version__.split('v')[1]) | ||
# assert secsie.__version__ == 'v2.1.0' |
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,18 @@ | ||
import secsie | ||
|
||
|
||
def test_whitespace_insensitivity(): | ||
""" | ||
Tests that secsie ignores whitespace in attribute declaration lines | ||
""" | ||
config = secsie.parse_config( | ||
""" | ||
key = value | ||
key2=value2 | ||
ur\t=mom | ||
""" | ||
) | ||
|
||
assert config['key'] == 'value' | ||
assert config['key2'] == 'value2' | ||
assert config['ur'] == 'mom' |