Aurélien Bompard has proposed merging 
lp:~abompard/mailman/import21-instances-test into lp:mailman.

Requested reviews:
  Mailman Coders (mailman-coders)

For more details, see:
https://code.launchpad.net/~abompard/mailman/import21-instances-test/+merge/254277

New test for the _BounceInfo mock class added in commit 7310.
-- 
Your team Mailman Coders is requested to review the proposed merge of 
lp:~abompard/mailman/import21-instances-test into lp:mailman.
=== modified file 'src/mailman/commands/cli_import.py'
--- src/mailman/commands/cli_import.py	2015-03-26 02:32:56 +0000
+++ src/mailman/commands/cli_import.py	2015-03-26 16:01:49 +0000
@@ -45,6 +45,8 @@
 
 @contextmanager
 def hacked_sys_modules():
+    #yield
+    #return
     assert 'Mailman.Bouncer' not in sys.modules
     sys.modules['Mailman.Bouncer'] = Bouncer
     try:

=== added file 'src/mailman/commands/tests/test_import.py'
--- src/mailman/commands/tests/test_import.py	1970-01-01 00:00:00 +0000
+++ src/mailman/commands/tests/test_import.py	2015-03-26 16:01:49 +0000
@@ -0,0 +1,56 @@
+# Copyright (C) 2011-2015 by the Free Software Foundation, Inc.
+#
+# This file is part of GNU Mailman.
+#
+# GNU Mailman is free software: you can redistribute it and/or modify it under
+# the terms of the GNU General Public License as published by the Free
+# Software Foundation, either version 3 of the License, or (at your option)
+# any later version.
+#
+# GNU Mailman is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
+# more details.
+#
+# You should have received a copy of the GNU General Public License along with
+# GNU Mailman.  If not, see <http://www.gnu.org/licenses/>.
+
+"""Test the `mailman import21` subcommand."""
+
+__all__ = [
+    'TestImport',
+    ]
+
+
+import unittest
+
+from mailman.app.lifecycle import create_list
+from mailman.commands.cli_import import Import21
+from mailman.testing.layers import ConfigLayer
+from mock import patch
+from pkg_resources import resource_filename
+
+
+
+class FakeArgs:
+    listname = ["[email protected]"]
+    pickle_file = [resource_filename(
+        'mailman.testing', 'config-with-instances.pck')]
+
+
+
+class TestImport(unittest.TestCase):
+    layer = ConfigLayer
+
+    def setUp(self):
+        self.command = Import21()
+        self.args = FakeArgs()
+        self.mlist = create_list('[email protected]')
+
+    @patch("mailman.commands.cli_import.import_config_pck")
+    def test_process(self, import_config_pck):
+        try:
+            self.command.process(self.args)
+        except ImportError:
+            self.fail("The pickle failed loading")
+        self.assertTrue(import_config_pck.called)

=== added file 'src/mailman/testing/config-with-instances.pck'
Binary files src/mailman/testing/config-with-instances.pck	1970-01-01 00:00:00 +0000 and src/mailman/testing/config-with-instances.pck	2015-03-26 16:01:49 +0000 differ
_______________________________________________
Mailman-coders mailing list
[email protected]
https://mail.python.org/mailman/listinfo/mailman-coders

Reply via email to