[Python-modules-commits] [python-pyld] 68/276: Pass all tests except frame embed overwrite.
Wolfgang Borgert
debacle at moszumanska.debian.org
Wed Oct 8 23:47:54 UTC 2014
This is an automated email from the git hooks/post-receive script.
debacle pushed a commit to branch master
in repository python-pyld.
commit 48d83363b4170209b745936d66cbe6714fc6b51f
Author: Dave Longley <dlongley at digitalbazaar.com>
Date: Fri Apr 27 01:31:24 2012 -0400
Pass all tests except frame embed overwrite.
---
lib/pyld/jsonld.py | 11 +++++------
tests/runtests.py | 6 ++----
2 files changed, 7 insertions(+), 10 deletions(-)
diff --git a/lib/pyld/jsonld.py b/lib/pyld/jsonld.py
index 23d5b45..fbe2027 100644
--- a/lib/pyld/jsonld.py
+++ b/lib/pyld/jsonld.py
@@ -286,7 +286,7 @@ class JsonLdProcessor:
options.setdefault('optimize', False)
# preserve frame context
- ctx = frame['@context'] or {}
+ ctx = frame.get('@context', {})
try:
# expand input
@@ -1508,7 +1508,7 @@ class JsonLdProcessor:
# create new subject or merge into existing one
subject = subjects.setdefault(name, {})
subject['@id'] = name
- for prop, objects in input:
+ for prop, objects in input.items():
# skip @id
if prop == '@id':
continue
@@ -1655,7 +1655,7 @@ class JsonLdProcessor:
state, output, prop, copy.deepcopy(o))
# handle defaults in order
- for prop in sorted(frame.items()):
+ for prop in sorted(frame.keys()):
# skip keywords
if _is_keyword(prop):
continue
@@ -1774,7 +1774,7 @@ class JsonLdProcessor:
# recurse into subject
o = {}
s = state['subjects'][id]
- for prop, v in s:
+ for prop, v in s.items():
# copy keywords
if _is_keyword(prop):
o[prop] = copy.deepcopy(v)
@@ -1876,7 +1876,7 @@ class JsonLdProcessor:
return input
# recurse through properties
- for prop, v in input:
+ for prop, v in input.items():
result = self._removePreserve(ctx, v)
container = JsonLdProcessor.getContextValue(
ctx, prop, '@container')
@@ -1982,7 +1982,6 @@ class JsonLdProcessor:
if _is_keyword(iri):
# return alias if available
aliases = ctx['keywords'][iri]
- print 'aliases: %s' % aliases
if len(aliases) > 0:
return aliases[0]
else:
diff --git a/tests/runtests.py b/tests/runtests.py
index 3816de2..72365ac 100644
--- a/tests/runtests.py
+++ b/tests/runtests.py
@@ -23,8 +23,8 @@ from pyld import jsonld
TEST_TYPES = [
'jld:ExpandTest',
'jld:NormalizeTest',
- 'jld:CompactTest']#,
- #'jld:FrameTest']
+ 'jld:CompactTest',
+ 'jld:FrameTest']
# FIXME: remove me
def _ntriple(s, p, o):
@@ -170,8 +170,6 @@ class TestRunner:
if not success or self.options.verbose:
print 'Expect:', json.dumps(expect, indent=2)
print 'Result:', json.dumps(result, indent=2)
- # FIXME: remove me
- raise Exception('REMOVE ME')
print 'Done. Total:%d Passed:%d Failed:%d' % (total, passed, failed)
--
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