Hello community,
here is the log from the commit of package python3-SPARQLWrapper for
openSUSE:Factory checked in at 2015-11-23 07:30:16
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/python3-SPARQLWrapper (Old)
and /work/SRC/openSUSE:Factory/.python3-SPARQLWrapper.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "python3-SPARQLWrapper"
Changes:
--------
---
/work/SRC/openSUSE:Factory/python3-SPARQLWrapper/python3-SPARQLWrapper.changes
2015-11-02 12:55:45.000000000 +0100
+++
/work/SRC/openSUSE:Factory/.python3-SPARQLWrapper.new/python3-SPARQLWrapper.changes
2015-11-23 07:30:17.000000000 +0100
@@ -1,0 +2,32 @@
+Sun Nov 22 00:56:41 UTC 2015 - [email protected]
+
+- specfile:
+ * remove pip and rfqlib as buildrequirements
+
+- update to version 1.7.5:
+ * Removed pip dependency on setup
+
+-------------------------------------------------------------------
+Sat Nov 7 05:47:24 UTC 2015 - [email protected]
+
+- specfile:
+ * require pip package
+
+- update to version 1.7.4:
+ * Fixed packaging (issue #66)
+
+- changes from version 1.7.3:
+ * Finally fixed the keepalive issue in all Pyhon versions (issue
+ #65)
+ * Removed old JSON layer in favor of the native json module
+
+-------------------------------------------------------------------
+Tue Nov 3 17:01:37 UTC 2015 - [email protected]
+
+- specfile:
+ * require: rdflib, keepalive
+
+- update to version 1.7.2:
+ * Moved to the new keepalive package (issues #53 and #61)
+
+-------------------------------------------------------------------
Old:
----
SPARQLWrapper-1.7.1.tar.gz
New:
----
SPARQLWrapper-1.7.5.tar.gz
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ python3-SPARQLWrapper.spec ++++++
--- /var/tmp/diff_new_pack.h3tIlQ/_old 2015-11-23 07:30:18.000000000 +0100
+++ /var/tmp/diff_new_pack.h3tIlQ/_new 2015-11-23 07:30:18.000000000 +0100
@@ -17,7 +17,7 @@
Name: python3-SPARQLWrapper
-Version: 1.7.1
+Version: 1.7.5
Release: 0
Summary: SPARQL Endpoint interface to Python
License: W3C
@@ -27,8 +27,10 @@
# for openSUSE 12.2
BuildRequires: python3
BuildRequires: python3-devel
+BuildRequires: python3-keepalive
BuildRequires: python3-setuptools
-Recommends: python3-rdflib
+Requires: python3-keepalive
+Requires: python3-rdflib
BuildRoot: %{_tmppath}/%{name}-%{version}-build
BuildArch: noarch
++++++ SPARQLWrapper-1.7.1.tar.gz -> SPARQLWrapper-1.7.5.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/SPARQLWrapper-1.7.1/MANIFEST.in
new/SPARQLWrapper-1.7.5/MANIFEST.in
--- old/SPARQLWrapper-1.7.1/MANIFEST.in 2015-10-29 12:55:50.000000000 +0100
+++ new/SPARQLWrapper-1.7.5/MANIFEST.in 2015-11-05 14:54:35.000000000 +0100
@@ -2,3 +2,4 @@
exclude Makefile
include test/*.py
include scripts/*.py
+include requirements.txt
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/SPARQLWrapper-1.7.1/PKG-INFO
new/SPARQLWrapper-1.7.5/PKG-INFO
--- old/SPARQLWrapper-1.7.1/PKG-INFO 2015-10-30 09:01:34.000000000 +0100
+++ new/SPARQLWrapper-1.7.5/PKG-INFO 2015-11-19 14:14:55.000000000 +0100
@@ -1,6 +1,6 @@
Metadata-Version: 1.1
Name: SPARQLWrapper
-Version: 1.7.1
+Version: 1.7.5
Summary: SPARQL Endpoint interface to Python
Home-page: http://rdflib.github.io/sparqlwrapper
Author: Ivan Herman, Sergio Fernández, Carlos Tejo Alonso, Alexey Zakhlestin
@@ -8,7 +8,7 @@
License: W3C SOFTWARE NOTICE AND LICENSE
Download-URL: https://github.com/RDFLib/sparqlwrapper/releases
Description: This is a wrapper around a SPARQL service. It helps in creating
the query URI and, possibly, convert the result into a more manageable format.
-Keywords: python SPARQL
+Keywords: python sparql rdf rdflib
Platform: any
Classifier: Development Status :: 5 - Production/Stable
Classifier: Intended Audience :: Developers
@@ -16,5 +16,3 @@
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 2
Classifier: Programming Language :: Python :: 3
-Requires: rdflib
-Requires: pycurl
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/SPARQLWrapper-1.7.1/README.md
new/SPARQLWrapper-1.7.5/README.md
--- old/SPARQLWrapper-1.7.1/README.md 2015-10-29 12:55:50.000000000 +0100
+++ new/SPARQLWrapper-1.7.5/README.md 2015-11-05 14:54:35.000000000 +0100
@@ -1,14 +1,15 @@
# SPARQL Endpoint interface to Python
[](https://travis-ci.org/RDFLib/sparqlwrapper)
+[](https://pypi.python.org/pypi/SPARQLWrapper)
The distribution contains:
-* `SPARQLWrapper`: the Python library. You should copy the directory somewhere
into your PYTHONPATH. Alternatively, you can also run the distutils scripts:
+* `SPARQLWrapper`: the Python library. You should copy the directory somewhere
into your `PYTHONPATH`. Alternatively, you can also run the distutils scripts:
python setup.py install
-* `test`: some unit tests
+* `test`: some unit and integrations tests
* `script`: some scripts to run the library against some SPARQL endpoints.
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/SPARQLWrapper-1.7.1/SPARQLWrapper/Wrapper.py
new/SPARQLWrapper-1.7.5/SPARQLWrapper/Wrapper.py
--- old/SPARQLWrapper-1.7.1/SPARQLWrapper/Wrapper.py 2015-10-29
12:56:08.000000000 +0100
+++ new/SPARQLWrapper-1.7.5/SPARQLWrapper/Wrapper.py 2015-11-05
14:54:35.000000000 +0100
@@ -32,7 +32,7 @@
import sys
import warnings
-import jsonlayer
+import json
from KeyCaseInsensitiveDict import KeyCaseInsensitiveDict
from SPARQLExceptions import QueryBadFormed, EndPointNotFound,
EndPointInternalError
from SPARQLUtils import deprecated
@@ -397,15 +397,15 @@
def setUseKeepAlive(self):
"""Make urllib2 use keep-alive.
- @raise ImportError: when could not be imported
urlgrabber.keepalive.HTTPHandler
+ @raise ImportError: when could not be imported keepalive.HTTPHandler
"""
try:
- from urlgrabber.keepalive import HTTPHandler
+ from keepalive import HTTPHandler
keepalive_handler = HTTPHandler()
opener = urllib2.build_opener(keepalive_handler)
urllib2.install_opener(opener)
except ImportError:
- warnings.warn("urlgrabber not installed in the system. The
execution of this method has no effect.")
+ warnings.warn("keepalive support not available, so the execution
of this method has no effect")
def isSparqlUpdateRequest(self):
""" Returns TRUE if SPARQLWrapper is configured for executing SPARQL
Update request
@@ -631,20 +631,6 @@
"""Method for the standard iterator."""
return self.response.next()
- @staticmethod
- def setJSONModule(module):
- """Set the Python module for encoding JSON data. If not an allowed
value, the setting is ignored.
- JSON modules supported:
- - ``simplejson``: http://code.google.com/p/simplejson/
- - ``cjson``: http://pypi.python.org/pypi/python-cjson
- - ``json``: This is the version of ``simplejson`` that is bundled
with the
- Python standard library since version 2.6
- (see http://docs.python.org/library/json.html)
- @param module: Possible values: are L{simplejson}, L{cjson}, L{json}.
All other cases raise a ValueError exception.
- @type module: string
- """
- jsonlayer.use(module)
-
def _convertJSON(self):
"""
Convert a JSON result into a Python dict. This method can be
overwritten in a subclass
@@ -652,7 +638,7 @@
@return: converted result
@rtype: Python dictionary
"""
- return jsonlayer.decode(self.response.read().decode("utf-8"))
+ return json.loads(self.response.read().decode("utf-8"))
def _convertXML(self):
"""
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/SPARQLWrapper-1.7.1/SPARQLWrapper/__init__.py
new/SPARQLWrapper-1.7.5/SPARQLWrapper/__init__.py
--- old/SPARQLWrapper-1.7.1/SPARQLWrapper/__init__.py 2015-10-30
09:00:37.000000000 +0100
+++ new/SPARQLWrapper-1.7.5/SPARQLWrapper/__init__.py 2015-11-19
14:13:09.000000000 +0100
@@ -163,7 +163,7 @@
@requires: U{RDFLib<http://rdflib.net>} package.
"""
-__version__ = "1.7.1"
+__version__ = "1.7.5"
"""The version of SPARQLWrapper"""
__authors__ = "Ivan Herman, Sergio Fernández, Carlos Tejo Alonso, Alexey
Zakhlestin"
@@ -178,7 +178,7 @@
__contact__ = "[email protected]"
"""Mail list to contact to other people RDFLib and SPARQLWrappers folks and
developers"""
-__date__ = "2014-10-01"
+__date__ = "2015-11-05"
"""Last update"""
__agent__ = "sparqlwrapper %s (rdflib.github.io/sparqlwrapper)" % __version__
@@ -192,4 +192,3 @@
from Wrapper import BASIC, DIGEST
from SmartWrapper import SPARQLWrapper2
-
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/SPARQLWrapper-1.7.1/SPARQLWrapper/jsonlayer.py
new/SPARQLWrapper-1.7.5/SPARQLWrapper/jsonlayer.py
--- old/SPARQLWrapper-1.7.1/SPARQLWrapper/jsonlayer.py 2015-10-29
12:55:50.000000000 +0100
+++ new/SPARQLWrapper-1.7.5/SPARQLWrapper/jsonlayer.py 1970-01-01
01:00:00.000000000 +0100
@@ -1,164 +0,0 @@
-# -*- coding: utf-8 -*-
-#
-# Copyright (C) 2009 Christopher Lenz
-# All rights reserved.
-#
-
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions
-# are met:
-
-# 1. Redistributions of source code must retain the above copyright
-# notice, this list of conditions and the following disclaimer.
-# 2. Redistributions in binary form must reproduce the above copyright
-# notice, this list of conditions and the following disclaimer in
-# the documentation and/or other materials provided with the
-# distribution.
-# 3. The name of the author may not be used to endorse or promote
-# products derived from this software without specific prior
-# written permission.
-
-# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS
-# OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
-# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
-# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
-# GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
-# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
-# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
-# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
-# IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-"""Thin abstraction layer over the different available modules for decoding
-and encoding JSON data.
-
-This module currently supports the following JSON modules:
- - ``simplejson``: http://code.google.com/p/simplejson/
- - ``cjson``: http://pypi.python.org/pypi/python-cjson
- - ``json``: This is the version of ``simplejson`` that is bundled with the
- Python standard library since version 2.6
- (see http://docs.python.org/library/json.html)
-
-The default behavior is to use ``simplejson`` if installed, and otherwise
-fallback to the standard library module. To explicitly tell SPARQLWrapper
-which module to use, invoke the `use()` function with the module name::
-
- import jsonlayer
- jsonlayer.use('cjson')
-
-In addition to choosing one of the above modules, you can also configure
-SPARQLWrapper to use custom decoding and encoding functions::
-
- import jsonlayer
- jsonlayer.use(decode=my_decode, encode=my_encode)
-
-"""
-
-__all__ = ['decode', 'encode', 'use']
-
-_initialized = False
-_using = None
-_decode = None
-_encode = None
-
-
-def decode(string):
- """Decode the given JSON string.
-
- :param string: the JSON string to decode
- :type string: basestring
- :return: the corresponding Python data structure
- :rtype: object
- """
- if not _initialized:
- _initialize()
- return _decode(string)
-
-
-def encode(obj):
- """Encode the given object as a JSON string.
-
- :param obj: the Python data structure to encode
- :type obj: object
- :return: the corresponding JSON string
- :rtype: basestring
- """
- if not _initialized:
- _initialize()
- return _encode(obj)
-
-
-def use(module=None, decode=None, encode=None):
- """Set the JSON library that should be used, either by specifying a known
- module name, or by providing a decode and encode function.
-
- The modules "simplejson", "cjson", and "json" are currently supported for
- the ``module`` parameter.
-
- If provided, the ``decode`` parameter must be a callable that accepts a
- JSON string and returns a corresponding Python data structure. The
- ``encode`` callable must accept a Python data structure and return the
- corresponding JSON string. Exceptions raised by decoding and encoding
- should be propagated up unaltered.
-
- :param module: the name of the JSON library module to use, or the module
object itself
- :type module: str or module
- :param decode: a function for decoding JSON strings
- :type decode: callable
- :param encode: a function for encoding objects as JSON strings
- :type encode: callable
- """
- global _decode, _encode, _initialized, _using
- if module is not None:
- if not isinstance(module, basestring):
- module = module.__name__
- if module not in ('cjson', 'json', 'simplejson'):
- raise ValueError('Unsupported JSON module %s' % module)
- _using = module
- _initialized = False
- else:
- assert decode is not None and encode is not None
- _using = 'custom'
- _decode = decode
- _encode = encode
- _initialized = True
-
-
-def _initialize():
- global _initialized
-
- def _init_simplejson():
- global _decode, _encode
- import simplejson
- _decode = lambda string, loads=simplejson.loads: loads(string)
- _encode = lambda obj, dumps=simplejson.dumps: \
- dumps(obj, allow_nan=False, ensure_ascii=False)
-
- def _init_cjson():
- global _decode, _encode
- import cjson
- _decode = lambda string, decode=cjson.decode: decode(string)
- _encode = lambda obj, encode=cjson.encode: encode(obj)
-
- def _init_stdlib():
- global _decode, _encode
- json = __import__('json', {}, {})
- _decode = lambda string, loads=json.loads: loads(string)
- _encode = lambda obj, dumps=json.dumps: \
- dumps(obj, allow_nan=False, ensure_ascii=False)
-
- if _using == 'simplejson':
- _init_simplejson()
- elif _using == 'cjson':
- _init_cjson()
- elif _using == 'json':
- _init_stdlib()
- elif _using != 'custom':
- try:
- _init_simplejson()
- except ImportError:
- _init_stdlib()
- _initialized = True
-
-
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/SPARQLWrapper-1.7.1/SPARQLWrapper.egg-info/PKG-INFO
new/SPARQLWrapper-1.7.5/SPARQLWrapper.egg-info/PKG-INFO
--- old/SPARQLWrapper-1.7.1/SPARQLWrapper.egg-info/PKG-INFO 2015-10-30
09:01:27.000000000 +0100
+++ new/SPARQLWrapper-1.7.5/SPARQLWrapper.egg-info/PKG-INFO 2015-11-19
14:14:47.000000000 +0100
@@ -1,6 +1,6 @@
Metadata-Version: 1.1
Name: SPARQLWrapper
-Version: 1.7.1
+Version: 1.7.5
Summary: SPARQL Endpoint interface to Python
Home-page: http://rdflib.github.io/sparqlwrapper
Author: Ivan Herman, Sergio Fernández, Carlos Tejo Alonso, Alexey Zakhlestin
@@ -8,7 +8,7 @@
License: W3C SOFTWARE NOTICE AND LICENSE
Download-URL: https://github.com/RDFLib/sparqlwrapper/releases
Description: This is a wrapper around a SPARQL service. It helps in creating
the query URI and, possibly, convert the result into a more manageable format.
-Keywords: python SPARQL
+Keywords: python sparql rdf rdflib
Platform: any
Classifier: Development Status :: 5 - Production/Stable
Classifier: Intended Audience :: Developers
@@ -16,5 +16,3 @@
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 2
Classifier: Programming Language :: Python :: 3
-Requires: rdflib
-Requires: pycurl
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/SPARQLWrapper-1.7.1/SPARQLWrapper.egg-info/SOURCES.txt
new/SPARQLWrapper-1.7.5/SPARQLWrapper.egg-info/SOURCES.txt
--- old/SPARQLWrapper-1.7.1/SPARQLWrapper.egg-info/SOURCES.txt 2015-10-30
09:01:27.000000000 +0100
+++ new/SPARQLWrapper-1.7.5/SPARQLWrapper.egg-info/SOURCES.txt 2015-11-19
14:14:47.000000000 +0100
@@ -2,7 +2,7 @@
MANAGEMENT.md
MANIFEST.in
README.md
-setup.cfg
+requirements.txt
setup.py
SPARQLWrapper/KeyCaseInsensitiveDict.py
SPARQLWrapper/SPARQLExceptions.py
@@ -10,7 +10,6 @@
SPARQLWrapper/SmartWrapper.py
SPARQLWrapper/Wrapper.py
SPARQLWrapper/__init__.py
-SPARQLWrapper/jsonlayer.py
SPARQLWrapper.egg-info/PKG-INFO
SPARQLWrapper.egg-info/SOURCES.txt
SPARQLWrapper.egg-info/dependency_links.txt
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/SPARQLWrapper-1.7.1/SPARQLWrapper.egg-info/requires.txt
new/SPARQLWrapper-1.7.5/SPARQLWrapper.egg-info/requires.txt
--- old/SPARQLWrapper-1.7.1/SPARQLWrapper.egg-info/requires.txt 2015-10-30
09:01:27.000000000 +0100
+++ new/SPARQLWrapper-1.7.5/SPARQLWrapper.egg-info/requires.txt 2015-11-19
14:14:47.000000000 +0100
@@ -1,2 +1,2 @@
-rdflib >= 4.0
-pycurl >= 7.19.5.1
+rdflib>=4.0
+keepalive>=0.4.1
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/SPARQLWrapper-1.7.1/requirements.txt
new/SPARQLWrapper-1.7.5/requirements.txt
--- old/SPARQLWrapper-1.7.1/requirements.txt 1970-01-01 01:00:00.000000000
+0100
+++ new/SPARQLWrapper-1.7.5/requirements.txt 2015-11-05 14:54:35.000000000
+0100
@@ -0,0 +1,2 @@
+rdflib>=4.0
+keepalive>=0.4.1
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/SPARQLWrapper-1.7.1/setup.py
new/SPARQLWrapper-1.7.5/setup.py
--- old/SPARQLWrapper-1.7.1/setup.py 2015-10-30 08:45:12.000000000 +0100
+++ new/SPARQLWrapper-1.7.5/setup.py 2015-11-19 14:12:26.000000000 +0100
@@ -8,7 +8,7 @@
except:
pass
-from setuptools import setup, find_packages
+from setuptools import setup
try:
import six
@@ -16,24 +16,7 @@
except:
py3 = sys.version_info[0] >= 3
-# grouping requires
-_requires = []
-_install_requires = []
-
-# rdflib
-_requires.append('rdflib')
-_install_requires.append('rdflib >= 4.0')
-
-# 7.19.5.1
-_requires.append('pycurl')
-_install_requires.append('pycurl >= 7.19.5.1')
-
-# simplejson
-if sys.version_info[0:2] < (2, 6):
- _requires.append('simplejson')
- _install_requires.append('simplejson == 2.0.9')
-
-# metainformation
+# metadata
if py3:
import re
_version_re = re.compile(r'__version__\s*=\s*"(.*)"')
@@ -55,21 +38,25 @@
authors = SPARQLWrapper.__authors__
url = SPARQLWrapper.__url__
-# actual setup configuration
+
+# requirements
+with open('requirements.txt', 'r') as f:
+ _install_requires = [line.rstrip('\n') for line in f]
+
+
setup(
name = 'SPARQLWrapper',
version = version,
description = 'SPARQL Endpoint interface to Python',
long_description = 'This is a wrapper around a SPARQL service. It helps
in creating the query URI and, possibly, convert the result into a more
manageable format.',
- license = 'W3C SOFTWARE NOTICE AND LICENSE', # should be removed by PEP
314
+ license = 'W3C SOFTWARE NOTICE AND LICENSE',
author = authors,
author_email = "ivan at ivan-herman net, sergio at wikier org,
carlos.tejo at gmail com, indeyets at gmail com",
url = url,
download_url = 'https://github.com/RDFLib/sparqlwrapper/releases',
- platforms = ['any'], # should be removed by PEP 314
+ platforms = ['any'],
packages = ['SPARQLWrapper'],
- requires = _requires, # used by distutils to create metadata PKG-INFO
- install_requires = _install_requires, # used by setuptools to install
the dependencies
+ install_requires = _install_requires,
classifiers = [
'Development Status :: 5 - Production/Stable',
'Intended Audience :: Developers',
@@ -78,8 +65,6 @@
'Programming Language :: Python :: 2',
'Programming Language :: Python :: 3',
],
- keywords = 'python SPARQL',
- use_2to3 = True,
- #requires_python = '>=2.5', # Future in PEP 345
- #scripts = ['ez_setup.py']
+ keywords = 'python sparql rdf rdflib',
+ use_2to3 = True
)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/SPARQLWrapper-1.7.1/test/dbpedia.py
new/SPARQLWrapper-1.7.5/test/dbpedia.py
--- old/SPARQLWrapper-1.7.1/test/dbpedia.py 2015-10-29 12:55:50.000000000
+0100
+++ new/SPARQLWrapper-1.7.5/test/dbpedia.py 2015-11-05 14:54:35.000000000
+0100
@@ -44,14 +44,14 @@
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
"""
-selectQuery = """
+selectQuery = """
SELECT ?label
WHERE {
<http://dbpedia.org/resource/Asturias> rdfs:label ?label .
}
"""
-constructQuery = """
+constructQuery = """
CONSTRUCT {
_:v rdfs:label ?label .
_:v rdfs:comment "this is only a mock node to test library"
@@ -238,6 +238,16 @@
# def testQueryManyPrefixes(self):
# result = self.__generic(queryManyPrefixes, XML, GET)
+ def testKeepAlive(self):
+ sparql = SPARQLWrapper(endpoint)
+ sparql.setQuery('SELECT * WHERE {?s ?p ?o} LIMIT 10')
+ sparql.setReturnFormat(JSON)
+ sparql.setMethod(GET)
+ sparql.setUseKeepAlive()
+
+ sparql.query()
+ sparql.query()
+
if __name__ == "__main__":
unittest.main()
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/SPARQLWrapper-1.7.1/test/wrapper_test.py
new/SPARQLWrapper-1.7.5/test/wrapper_test.py
--- old/SPARQLWrapper-1.7.1/test/wrapper_test.py 2015-10-29
12:55:50.000000000 +0100
+++ new/SPARQLWrapper-1.7.5/test/wrapper_test.py 2015-11-05
14:54:35.000000000 +0100
@@ -90,8 +90,7 @@
@staticmethod
def _get_request(wrapper):
- request = wrapper.query().response.request # possible due to mock
above
- return request
+ return wrapper.query().response.request # possible due to mock above
@staticmethod
def _get_parameters_from_request(request):
@@ -232,7 +231,14 @@
self.assertTrue(request.has_header('Authorization'))
# expected header for login:password
- self.assertEqual("Basic bG9naW46cGFzc3dvcmQ=",
request.get_header('Authorization'))
+ #self.assertEqual("Basic bG9naW46cGFzc3dvcmQ=",
request.get_header('Authorization'))
+ auth = request.get_header('Authorization').split(" ")
+ self.assertEqual(2, len(auth))
+ self.assertEqual("Basic", auth[0])
+ if auth[1].startswith("b'"): #sequence of octets
+ self.assertEqual("bG9naW46cGFzc3dvcmQ=", auth[1][2:-1])
+ else:
+ self.assertEqual("bG9naW46cGFzc3dvcmQ=", auth[1])
def testSetHTTPAuth(self):
self.assertRaises(TypeError, self.wrapper.setHTTPAuth, 123)
@@ -491,6 +497,7 @@
class QueryResult_Test(unittest.TestCase):
+
def testConstructor(self):
qr = QueryResult('result')
self.assertEqual('result', qr.response)
@@ -587,6 +594,6 @@
self.assertEqual(1, _mime_vs_type("application/rdf+xml", JSON))
self.assertEqual(1, _mime_vs_type("application/rdf+xml", N3))
+
if __name__ == "__main__":
unittest.main()
-