diff options
Diffstat (limited to 'tests/test_util.py')
-rw-r--r-- | tests/test_util.py | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/tests/test_util.py b/tests/test_util.py new file mode 100644 index 0000000..109e0be --- /dev/null +++ b/tests/test_util.py @@ -0,0 +1,11 @@ +from pecan.util import compat_splitext + +def test_compat_splitext(): + assert ('foo', '.bar') == compat_splitext('foo.bar') + assert ('/foo/bar', '.txt') == compat_splitext('/foo/bar.txt') + assert ('/foo/bar', '') == compat_splitext('/foo/bar') + assert ('.bashrc', '') == compat_splitext('.bashrc') + assert ('..bashrc', '') == compat_splitext('..bashrc') + assert ('/.bashrc', '') == compat_splitext('/.bashrc') + assert ('/foo.bar/.bashrc', '') == compat_splitext('/foo.bar/.bashrc') + assert ('/foo.js', '.js') == compat_splitext('/foo.js.js') |