summaryrefslogtreecommitdiff
path: root/pkg_resources
diff options
context:
space:
mode:
authorJason R. Coombs <jaraco@jaraco.com>2019-02-13 15:16:21 -0500
committerJason R. Coombs <jaraco@jaraco.com>2019-02-13 15:16:21 -0500
commitad98fcb350fa3ce63389520a391e23274de11064 (patch)
treeb6aeca48a7435b1ab734f6b493f9176a4deef51e /pkg_resources
parentcdb5eeae678d8ccc90bf7d4348013a294f11be75 (diff)
downloadpython-setuptools-git-ad98fcb350fa3ce63389520a391e23274de11064.tar.gz
Add two tests capturing expectation for '' and None to _validate_resource_path. Ref #1686.
Diffstat (limited to 'pkg_resources')
-rw-r--r--pkg_resources/__init__.py13
1 files changed, 13 insertions, 0 deletions
diff --git a/pkg_resources/__init__.py b/pkg_resources/__init__.py
index dcfa1d08..5d66f6e0 100644
--- a/pkg_resources/__init__.py
+++ b/pkg_resources/__init__.py
@@ -1512,6 +1512,19 @@ is not allowed.
...
ValueError: Use of .. or absolute path in a resource path \
is not allowed.
+
+ Blank values are allowed
+
+ >>> vrp('')
+ >>> bool(warned)
+ False
+
+ Non-string values are not.
+
+ >>> vrp(None)
+ Traceback (most recent call last):
+ ...
+ AttributeError: ...
"""
invalid = (
os.path.pardir in path.split(posixpath.sep) or