[python-rdflib/f15] Re-enable unit-tests

Pierre-YvesChibon pingou at fedoraproject.org
Tue Feb 7 10:56:48 UTC 2012


commit ec456df65e78387de50f0c5003a196f7159f2554
Author: Pierre-Yves Chibon <pingou at pingoured.fr>
Date:   Tue Feb 7 11:45:14 2012 +0100

    Re-enable unit-tests

 ...-Skip-test-if-it-can-not-join-the-network.patch |   37 ++++++++++++++++++++
 python-rdflib.spec                                 |   13 +++++--
 2 files changed, 47 insertions(+), 3 deletions(-)
---
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
new file mode 100644
index 0000000..40c78ea
--- /dev/null
+++ b/0001-Skip-test-if-it-can-not-join-the-network.patch
@@ -0,0 +1,37 @@
+From 3e183cd71f8588a2b5d0958aa09d1b8dcb0eb86d Mon Sep 17 00:00:00 2001
+From: Pierre-Yves Chibon <pingou at pingoured.fr>
+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 1049289..6247eaa 100644
--- a/python-rdflib.spec
+++ b/python-rdflib.spec
@@ -1,7 +1,7 @@
 # The upstream test suite does not pass on recent versions of Fedora
 # See package review (bug 378841)
 # For now, we disable running the test suite:
-%define run_tests 0
+%define run_tests 1
 
 Name:           python-rdflib
 Version:        3.2.0
@@ -12,12 +12,15 @@ Group:          Development/Languages
 License:        BSD
 URL:            http://rdflib.net
 Source0:        http://rdflib.googlecode.com/files/rdflib-%{version}.tar.gz
+# Upstreamed: http://code.google.com/p/rdflib/issues/detail?id=206
+Patch0:         0001-Skip-test-if-it-can-not-join-the-network.patch
 BuildArch:      noarch
 
 BuildRoot:      %(mktemp -ud %{_tmppath}/%{name}-%{version}-%{release}-XXXXXX)
 Requires:       python-isodate
 
 BuildRequires:  python-devel
+BuildRequires:  python-isodate
 %if 0%{?fedora} >= 8
 BuildRequires: python-setuptools-devel
 %else
@@ -40,6 +43,8 @@ memory, MySQL, Redland, SQLite, Sleepycat, ZODB and SQLObject.
 %prep
 %setup -q -n rdflib-%{version}
 
+%patch0 -p0 -b .test
+
 %build
 %{__python} setup.py build
 
@@ -62,6 +67,7 @@ chmod +x $RPM_BUILD_ROOT/%{python_sitelib}/rdflib/plugins/parsers/notation3.py
 
 %check
 %if %{run_tests}
+sed -i -e "s|'--with-doctest'|#'--with-doctest'|" run_tests.py
 %{__python} run_tests.py
 %endif
 
@@ -74,8 +80,9 @@ rm -rf $RPM_BUILD_ROOT
 %{python_sitelib}/*
 
 %changelog
-* Mon Jan 23 2012 Pierre-Yves Chibon <pingou at pingoured.fr> - 3.2.0-2
-- Add python-isodate as R (RHBZ#784027)
+* Tue Feb 07 2012 Pierre-Yves Chibon <pingou at pingoured.fr> - 3.2.0-2
+- Add python-isodate as R and BR(RHBZ#784027)
+- Re-enable the unit-tests
 
 * Fri Jan 20 2012 Pierre-Yves Chibon <pingou at pingoured.fr> - 3.2.0-1
 - Update to 3.2.0


More information about the scm-commits mailing list