From c9394c6d40d69f37b3955e8228685d3699bc3cf9 Mon Sep 17 00:00:00 2001 From: Pierre-Yves Chibon Date: Oct 10 2012 14:59:21 +0000 Subject: Fix unit-test and remove old patch --- diff --git a/0001-Skip-test-if-it-can-not-join-the-network.patch b/0001-Skip-test-if-it-can-not-join-the-network.patch deleted file mode 100644 index 40c78ea..0000000 --- a/0001-Skip-test-if-it-can-not-join-the-network.patch +++ /dev/null @@ -1,37 +0,0 @@ -From 3e183cd71f8588a2b5d0958aa09d1b8dcb0eb86d Mon Sep 17 00:00:00 2001 -From: Pierre-Yves Chibon -Date: Tue, 24 Jan 2012 20:29:13 +0100 -Subject: [PATCH] Skip test if it can not join the network - ---- - test/test_n3.py | 7 ++++++- - 1 files changed, 6 insertions(+), 1 deletions(-) - -diff --git a/test/test_n3.py b/test/test_n3.py -index 2fa54af..c419acf 100644 ---- test/test_n3.py -+++ test/test_n3.py -@@ -60,6 +60,7 @@ n3:context a rdf:Property; rdfs:domain n3:statement; - - - import unittest -+from urllib2 import URLError - - from rdflib.graph import Graph, ConjunctiveGraph - -@@ -160,7 +161,11 @@ foo-bar:Ex foo-bar:name "Test" . """ - - def testParse(self): - g = ConjunctiveGraph() -- g.parse("http://groups.csail.mit.edu/dig/2005/09/rein/examples/troop42-policy.n3", format="n3") -+ try: -+ g.parse("http://groups.csail.mit.edu/dig/2005/09/rein/examples/troop42-policy.n3", format="n3") -+ except URLError: -+ from nose import SkipTest -+ raise SkipTest('No network to retrieve the information, skipping test') - - cases = ['no quotes', - "single ' quote", --- -1.7.7.6 - diff --git a/python-rdflib.spec b/python-rdflib.spec index 219e540..b775e1e 100644 --- a/python-rdflib.spec +++ b/python-rdflib.spec @@ -1,15 +1,14 @@ -%define run_tests 0 +%define run_tests 1 Name: python-rdflib Version: 3.2.3 -Release: 1%{?dist} +Release: 2%{?dist} Summary: Python library for working with RDF Group: Development/Languages License: BSD URL: http://code.google.com/p/rdflib/ Source0: http://pypi.python.org/packages/source/r/rdflib/rdflib-%{version}.tar.gz -# Upstreamed: http://code.google.com/p/rdflib/issues/detail?id=206 BuildArch: noarch BuildRoot: %(mktemp -ud %{_tmppath}/%{name}-%{version}-%{release}-XXXXXX) @@ -38,6 +37,10 @@ memory, MySQL, Redland, SQLite, Sleepycat, ZODB and SQLObject. %prep %setup -q -n rdflib-%{version} +find -name "*.pyc" -delete + +sed -i -e 's|_sn_gen=bnode_uuid()|_sn_gen=bnode_uuid|' test/test_bnode_ncname.py + %build %{__python} setup.py build @@ -53,10 +56,10 @@ cp LICENSE $RPM_BUILD_ROOT/%{python_sitelib}/rdflib/LICENSE # executable as appropriate: # __main__ parses URI as N-Triples: -#chmod +x $RPM_BUILD_ROOT/%{python_sitelib}/rdflib/plugins/parsers/ntriples.py +chmod +x $RPM_BUILD_ROOT/%{python_sitelib}/rdflib/plugins/parsers/ntriples.py # __main__ parses the file given on the command line: -#chmod +x $RPM_BUILD_ROOT/%{python_sitelib}/rdflib/plugins/parsers/notation3.py +chmod +x $RPM_BUILD_ROOT/%{python_sitelib}/rdflib/plugins/parsers/notation3.py %check @@ -74,6 +77,11 @@ rm -rf $RPM_BUILD_ROOT %{python_sitelib}/* %changelog +* Wed Oct 10 2012 Pierre-Yves Chibon - 3.2.3-2 +- Re-enable tests +- Backport using sed unit-tests fix from upstream + (commit 26d25faa90483ed1ba7675d159d10e955dbaf442) + * Wed Oct 10 2012 Pierre-Yves Chibon - 3.2.3-1 - Update to 3.2.3 - One test is failing, so disabling them for now