[PATCH saem] [test] Fix failures due to recent oaipmh cube release

Sylvain Thenault sylvain.thenault at logilab.fr
Wed Aug 16 18:25:30 CEST 2017

# HG changeset patch
# User Sylvain Thénault <sylvain.thenault at logilab.fr>
# Date 1502900537 -7200
#      Wed Aug 16 18:22:17 2017 +0200
# Node ID e5de53db77871e1ac8fa574c82a116c14b41d981
# Parent  3b78f9dfd44f0e36f0534eef70596d20d722671e
# Available At http://hg.logilab.org/review/cubes/saem_ref
#              hg pull http://hg.logilab.org/review/cubes/saem_ref -r e5de53db7787
[test] Fix failures due to recent oaipmh cube release

pyramid API is now used there for url handling instead of cubicweb's,
requiring some test update.

diff --git a/test/test_oai.py b/test/test_oai.py
--- a/test/test_oai.py
+++ b/test/test_oai.py
@@ -138,11 +138,11 @@ class OAIRequestTC(CubicWebTC):
                     'set arguments results in an empty list.')),
                 ('conceptscheme:haha', 'invalid set specifier conceptscheme:haha'),
                 ('scregneugneu', 'invalid set specifier scregneugneu'),
                 with self.subTest(setspec=setspec):
-                    oairq = OAIRequest('http://testing.fr', setspec=setspec)
+                    oairq = OAIRequest('https://localhost:80', setspec=setspec)
                     with self.assertRaises(OAIError) as cm:
                     self.assertEqual(cm.exception.errors, {'noRecordsMatch': msg})
@@ -225,30 +225,30 @@ class OAIPMHViewsTC(PyramidCWTest, OAITe
     def test_noverb(self):
         with self.admin_access.web_request() as req:
             result = self.oai_request(req)
-        self.assertIn('<request>http://testing.fr/cubicweb/oai</request>',
+        self.assertIn('<request>https://localhost:80/oai</request>',
         self.assertIn('<error code="badVerb">no verb specified</error',
     def test_badverb(self):
         with self.admin_access.web_request() as req:
             result = self.oai_request(req, verb='coucou')
-        self.assertIn('<request>http://testing.fr/cubicweb/oai</request>',
+        self.assertIn('<request>https://localhost:80/oai</request>',
         self.assertIn('<error code="badVerb">illegal verb "coucou"</error>',
     # some of our setspecs (those with an ARK inside are not valid)
     def test_listsets(self):
         pscheme, dscheme = self._setup_schemes()
         with self.admin_access.web_request() as req:
             result = self.oai_request(req, verb='ListSets')
-        self.assertIn('<request verb="ListSets">http://testing.fr/cubicweb/oai</request>',
+        self.assertIn('<request verb="ListSets">https://localhost:80/oai</request>',
         for spec in ('agent', 'organizationunit', 'conceptscheme', 'profile',

More information about the saem-devel mailing list