From ad98fcb350fa3ce63389520a391e23274de11064 Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Wed, 13 Feb 2019 15:16:21 -0500 Subject: Add two tests capturing expectation for '' and None to _validate_resource_path. Ref #1686. --- pkg_resources/__init__.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'pkg_resources/__init__.py') 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 -- cgit v1.2.3