[saem-devel] [PATCH 6 of 6] Fix imports in test following new layout

Sylvain Thenault sylvain.thenault at logilab.fr
Fri Jan 27 14:50:21 CET 2017


# HG changeset patch
# User Sylvain Thénault <sylvain.thenault at logilab.fr>
# Date 1485274396 -3600
#      Tue Jan 24 17:13:16 2017 +0100
# Node ID 58451f28ca560a7617901aef894683b35d659532
# Parent  529af6659bd62d0894f18dfe92b90db30eea6729
Fix imports in test following new layout

Test fails without this because aliased modules are unexpectedly loaded twice.

diff --git a/test/test_oai.py b/test/test_oai.py
--- a/test/test_oai.py
+++ b/test/test_oai.py
@@ -25,11 +25,11 @@ import pytz
 
 from cubicweb.devtools.testlib import CubicWebTC
 
 from cubes.oaipmh.views import OAIError, OAIRequest
 
-from cubes.saem_ref import permanent_url
+from cubicweb_saem_ref import permanent_url
 
 import testutils
 
 
 EntityInfo = namedtuple('EntityInfo', ['ark', 'url', 'eid'])
diff --git a/test/test_saem_ref.py b/test/test_saem_ref.py
--- a/test/test_saem_ref.py
+++ b/test/test_saem_ref.py
@@ -41,11 +41,11 @@ from functools import partial
 from unittest import TestCase
 from logilab.common import attrdict
 
 from cubicweb.devtools import testlib
 
-from cubes.saem_ref import cwuri_url
+from cubicweb_saem_ref import cwuri_url
 
 import testutils
 
 
 class CWURI_URLTC(TestCase):
diff --git a/test/test_seda.py b/test/test_seda.py
--- a/test/test_seda.py
+++ b/test/test_seda.py
@@ -17,13 +17,14 @@
 
 import unittest
 
 from cubicweb.devtools.testlib import CubicWebTC
 
-from cubes.saem_ref.entities import seda  # noqa - trigger monkey-patch
 from cubes.seda.entities.profile_generation import SEDA1XSDExport
 
+from cubicweb_saem_ref.entities import seda  # noqa - trigger monkey-patch
+
 import testutils
 
 
 class CWURIURLTC(unittest.TestCase):
 
diff --git a/test/test_views.py b/test/test_views.py
--- a/test/test_views.py
+++ b/test/test_views.py
@@ -31,11 +31,11 @@ from yams.schema import role_name
 
 from cubicweb.devtools.testlib import CubicWebTC
 
 from cubes.skos.rdfio import default_graph
 
-from cubes.saem_ref.views.widgets import process_incomplete_date
+from cubicweb_saem_ref.views.widgets import process_incomplete_date
 
 import testutils
 
 
 def eid_from_ark(ark):
diff --git a/test/unittest_autocomplete.py b/test/unittest_autocomplete.py
--- a/test/unittest_autocomplete.py
+++ b/test/unittest_autocomplete.py
@@ -21,11 +21,11 @@ import json
 from logilab.common import flatten
 
 from cubicweb.devtools import PostgresApptestConfiguration
 from cubicweb.devtools.testlib import CubicWebTC
 
-from cubes.saem_ref.views.autocompletesearch import words_matching_term
+from cubicweb_saem_ref.views.autocompletesearch import words_matching_term
 
 import testutils
 
 
 def setUpModule():
diff --git a/test/unittest_entities_agent.py b/test/unittest_entities_agent.py
--- a/test/unittest_entities_agent.py
+++ b/test/unittest_entities_agent.py
@@ -19,11 +19,12 @@ import datetime
 
 from cubicweb.devtools.testlib import CubicWebTC
 
 from cubes.skos.rdfio import RDFLibRDFGraph, RDFRegistry
 
-from cubes.saem_ref import permanent_url
+from cubicweb_saem_ref import permanent_url
+
 import testutils
 
 
 class RDFExportTC(testutils.XmlTestMixin, CubicWebTC):
     """Test case for RDF export"""
diff --git a/test/unittest_entities_container.py b/test/unittest_entities_container.py
--- a/test/unittest_entities_container.py
+++ b/test/unittest_entities_container.py
@@ -15,11 +15,11 @@
 # with this program. If not, see <http://www.gnu.org/licenses/>.
 """cubicweb-saem_ref unit tests for entities.container"""
 
 from cubicweb.devtools.testlib import CubicWebTC
 
-from cubes.saem_ref.entities import container
+from cubicweb_saem_ref.entities import container
 
 import testutils
 
 
 def sort_container(container_def):
diff --git a/test/unittest_hooks.py b/test/unittest_hooks.py
--- a/test/unittest_hooks.py
+++ b/test/unittest_hooks.py
@@ -21,11 +21,11 @@ import unittest
 
 import pytz
 
 from cubicweb.devtools.testlib import CubicWebTC
 
-from cubes.saem_ref.hooks import extract_ark
+from cubicweb_saem_ref.hooks import extract_ark
 
 import testutils
 
 YESTERDAY = datetime.now(tz=pytz.utc) - timedelta(days=1)
 
diff --git a/test/unittest_schema.py b/test/unittest_schema.py
--- a/test/unittest_schema.py
+++ b/test/unittest_schema.py
@@ -22,12 +22,12 @@ from contextlib import contextmanager
 from six.moves import reduce
 
 from cubicweb import ValidationError, Unauthorized, neg_role
 from cubicweb.devtools.testlib import CubicWebTC
 
-from cubes.saem_ref import (PERMISSIONS_GRAPHS, mandatory_rdefs,
-                            optional_relations)
+from cubicweb_saem_ref import (PERMISSIONS_GRAPHS, mandatory_rdefs,
+                               optional_relations)
 
 import testutils
 
 
 def graph_relations(schema, parent_structure):
diff --git a/test/unittest_site_cubicweb.py b/test/unittest_site_cubicweb.py
--- a/test/unittest_site_cubicweb.py
+++ b/test/unittest_site_cubicweb.py
@@ -19,11 +19,11 @@ from datetime import datetime
 
 import unittest
 
 from cubicweb import devtools  # noqa
 
-from cubes.saem_ref.site_cubicweb import print_tzdatetime_local
+from cubicweb_saem_ref.site_cubicweb import print_tzdatetime_local
 
 
 class PrintTZDatetimeTC(unittest.TestCase):
 
     def test(self):


More information about the saem-devel mailing list