[ckan-changes] commit/ckanext-dgu: dread: [pip-requirements]: #1168 Fix tests following move round.

Bitbucket commits-noreply at bitbucket.org
Mon May 30 17:51:00 UTC 2011


1 new changeset in ckanext-dgu:

http://bitbucket.org/okfn/ckanext-dgu/changeset/9b560525600b/
changeset:   9b560525600b
branches:    
user:        dread
date:        2011-05-30 19:50:45
summary:     [pip-requirements]: #1168 Fix tests following move round.
affected #:  8 files (575 bytes)

--- a/ckanext/dgu/bin/change_licenses_cmd.py	Mon May 30 17:46:46 2011 +0100
+++ b/ckanext/dgu/bin/change_licenses_cmd.py	Mon May 30 18:50:45 2011 +0100
@@ -1,8 +1,8 @@
 import sys
 
 from ckanext.importlib.loader import ResourceSeries
-from ckanext.dgu.scripts.change_licenses import ChangeLicenses
-from ckanext.dgu.scripts.mass_changer_cmd import MassChangerCommand
+from ckanext.dgu.bin.change_licenses import ChangeLicenses
+from ckanext.dgu.bin.mass_changer_cmd import MassChangerCommand
 from ckanclient import CkanClient
 
 class ChangeLicensesCommand(MassChangerCommand):


--- a/ckanext/dgu/bin/transfer_url_cmd.py	Mon May 30 17:46:46 2011 +0100
+++ b/ckanext/dgu/bin/transfer_url_cmd.py	Mon May 30 18:50:45 2011 +0100
@@ -1,6 +1,6 @@
 from ckanext.importlib.loader import ResourceSeries
-from ckanext.dgu.scripts.transfer_url import TransferUrl
-from ckanext.dgu.scripts.mass_changer_cmd import MassChangerCommand
+from ckanext.dgu.bin.transfer_url import TransferUrl
+from ckanext.dgu.bin.mass_changer_cmd import MassChangerCommand
 from ckanclient import CkanClient
 
 class TransferUrlCommand(MassChangerCommand):


--- a/ckanext/dgu/tests/bin/__init__.py	Mon May 30 17:46:46 2011 +0100
+++ b/ckanext/dgu/tests/bin/__init__.py	Mon May 30 18:50:45 2011 +0100
@@ -1,4 +0,0 @@
-from ckan.lib.create_test_data import CreateTestData
-
-def teardown_module():
-    assert not CreateTestData.get_all_data(), 'A test in module %r forgot to clean-up its data: %r' % (__name__, CreateTestData.get_all_data())


--- a/ckanext/dgu/tests/bin/test_change_licenses.py	Mon May 30 17:46:46 2011 +0100
+++ b/ckanext/dgu/tests/bin/test_change_licenses.py	Mon May 30 18:50:45 2011 +0100
@@ -18,8 +18,9 @@
         self.testclient = WsgiCkanClient(self.app, api_key=user.apikey, base_location='/api/2')
 
     @classmethod
-    def teardown_class(self):
-        CreateTestData.delete()
+    def teardown_class(cls):
+        model.Session.remove()
+        model.repo.rebuild_db()
 
     def get_licenses(self):
         q = model.Session.query(model.Package)


--- a/ckanext/dgu/tests/bin/test_mass_changer.py	Mon May 30 17:46:46 2011 +0100
+++ b/ckanext/dgu/tests/bin/test_mass_changer.py	Mon May 30 18:50:45 2011 +0100
@@ -21,7 +21,7 @@
 
     @classmethod
     def teardown_class(self):
-        CreateTestData.delete()
+        model.repo.rebuild_db()
 
     def test_0_change_pkg(self):
         anna_before = self.anna.as_dict()


--- a/ckanext/dgu/tests/bis/__init__.py	Mon May 30 17:46:46 2011 +0100
+++ b/ckanext/dgu/tests/bis/__init__.py	Mon May 30 18:50:45 2011 +0100
@@ -1,4 +0,0 @@
-from ckan.lib.create_test_data import CreateTestData
-
-def teardown_module():
-    assert not CreateTestData.get_all_data(), 'A test in module %r forgot to clean-up its data: %r' % (__name__, CreateTestData.get_all_data())


--- a/ckanext/dgu/tests/bis/test_bis.py	Mon May 30 17:46:46 2011 +0100
+++ b/ckanext/dgu/tests/bis/test_bis.py	Mon May 30 18:50:45 2011 +0100
@@ -162,6 +162,10 @@
         self.importer = BisImporter(filepath=self._filepath)
         self.pkg_dicts = [pkg_dict for pkg_dict in self.importer.pkg_dict()]
 
+    @classmethod
+    def teardown_class(cls):
+        model.repo.rebuild_db()
+        
     def test_0_munge(self):
         def test_munge(name, expected_munge):
             munge = self.importer.name_munge(name)

Repository URL: https://bitbucket.org/okfn/ckanext-dgu/

--

This is a commit notification from bitbucket.org. You are receiving
this because you have the service enabled, addressing the recipient of
this email.




More information about the ckan-changes mailing list