[Python-modules-commits] [python-pyld] 03/05: Make it easier to run local (non-official) json-ld tests.
Wolfgang Borgert
debacle at moszumanska.debian.org
Tue Oct 13 22:56:25 UTC 2015
This is an automated email from the git hooks/post-receive script.
debacle pushed a commit to tag 0.6.6
in repository python-pyld.
commit f878162eb94f475f6591ae0be1be5fdb359def13
Author: Dave Longley <dlongley at digitalbazaar.com>
Date: Thu Dec 4 16:15:03 2014 -0500
Make it easier to run local (non-official) json-ld tests.
---
tests/runtests.py | 12 ++++++++----
1 file changed, 8 insertions(+), 4 deletions(-)
diff --git a/tests/runtests.py b/tests/runtests.py
index 8c7fb3e..b78ab78 100644
--- a/tests/runtests.py
+++ b/tests/runtests.py
@@ -297,9 +297,13 @@ def create_document_loader(test):
raise Exception('multiple context link headers')
doc['contextUrl'] = link_header['target']
global ROOT_MANIFEST_DIR
- #filename = os.path.join(
- # ROOT_MANIFEST_DIR, doc['documentUrl'][len(base):])
- filename = ROOT_MANIFEST_DIR + doc['documentUrl'][len(base):]
+ if doc['documentUrl'].find(':') == -1:
+ filename = os.path.join(ROOT_MANIFEST_DIR, doc['documentUrl'])
+ doc['documentUrl'] = 'file://' + filename
+ else:
+ #filename = os.path.join(
+ # ROOT_MANIFEST_DIR, doc['documentUrl'][len(base):])
+ filename = ROOT_MANIFEST_DIR + doc['documentUrl'][len(base):]
try:
doc['document'] = read_json(filename)
except:
@@ -308,7 +312,7 @@ def create_document_loader(test):
def local_loader(url):
# always load remote-doc and non-base tests remotely
- if (not url.startswith(base) or
+ if ((not url.startswith(base) and url.find(':') != -1) or
test.manifest.data.get('name') == 'Remote document'):
return loader(url)
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/python-modules/packages/python-pyld.git
More information about the Python-modules-commits
mailing list