summaryrefslogtreecommitdiff
path: root/src/mailman/testing
diff options
context:
space:
mode:
authorBarry Warsaw2014-04-14 12:14:13 -0400
committerBarry Warsaw2014-04-14 12:14:13 -0400
commit403cbf23c07839b60c85c0bc791b6437f05c8a85 (patch)
treeb36d0ecab20e01f23bcf66ab2b27633aaf3e99c3 /src/mailman/testing
parentff6df86000da8fcb055101c5cede36b27cb0480a (diff)
parent3a9725b91ef822122a70170333d71b58e1788a78 (diff)
downloadmailman-403cbf23c07839b60c85c0bc791b6437f05c8a85.tar.gz
mailman-403cbf23c07839b60c85c0bc791b6437f05c8a85.tar.zst
mailman-403cbf23c07839b60c85c0bc791b6437f05c8a85.zip
Trunk merge
Diffstat (limited to 'src/mailman/testing')
-rw-r--r--src/mailman/testing/documentation.py2
-rw-r--r--src/mailman/testing/helpers.py10
-rw-r--r--src/mailman/testing/i18n.py2
-rw-r--r--src/mailman/testing/layers.py2
-rw-r--r--src/mailman/testing/mailman-xx.po2
-rw-r--r--src/mailman/testing/mta.py2
-rw-r--r--src/mailman/testing/nose.py12
-rw-r--r--src/mailman/testing/testing.cfg2
8 files changed, 23 insertions, 11 deletions
diff --git a/src/mailman/testing/documentation.py b/src/mailman/testing/documentation.py
index b1cc36f91..d204a008f 100644
--- a/src/mailman/testing/documentation.py
+++ b/src/mailman/testing/documentation.py
@@ -1,4 +1,4 @@
-# Copyright (C) 2007-2013 by the Free Software Foundation, Inc.
+# Copyright (C) 2007-2014 by the Free Software Foundation, Inc.
#
# This file is part of GNU Mailman.
#
diff --git a/src/mailman/testing/helpers.py b/src/mailman/testing/helpers.py
index 8201f952a..1ef9e964e 100644
--- a/src/mailman/testing/helpers.py
+++ b/src/mailman/testing/helpers.py
@@ -1,4 +1,4 @@
-# Copyright (C) 2008-2013 by the Free Software Foundation, Inc.
+# Copyright (C) 2008-2014 by the Free Software Foundation, Inc.
#
# This file is part of GNU Mailman.
#
@@ -46,6 +46,7 @@ import mock
import time
import uuid
import errno
+import shutil
import signal
import socket
import logging
@@ -326,6 +327,8 @@ def call_api(url, data=None, method=None, username=None, password=None):
else:
method = 'POST'
method = method.upper()
+ if method in ('POST', 'PUT', 'PATCH') and data is None:
+ data = urlencode({}, doseq=True)
basic_auth = '{0}:{1}'.format(
(config.webservice.admin_user if username is None else username),
(config.webservice.admin_pass if password is None else password))
@@ -478,6 +481,11 @@ def reset_the_world():
with transaction():
for message in message_store.messages:
message_store.delete_message(message['message-id'])
+ # Delete any other residual messages.
+ for dirpath, dirnames, filenames in os.walk(config.MESSAGES_DIR):
+ for filename in filenames:
+ os.remove(os.path.join(dirpath, filename))
+ shutil.rmtree(dirpath)
# Reset the global style manager.
getUtility(IStyleManager).populate()
# Remove all dynamic header-match rules.
diff --git a/src/mailman/testing/i18n.py b/src/mailman/testing/i18n.py
index ec2b93b51..310815917 100644
--- a/src/mailman/testing/i18n.py
+++ b/src/mailman/testing/i18n.py
@@ -1,4 +1,4 @@
-# Copyright (C) 2009-2013 by the Free Software Foundation, Inc.
+# Copyright (C) 2009-2014 by the Free Software Foundation, Inc.
#
# This file is part of GNU Mailman.
#
diff --git a/src/mailman/testing/layers.py b/src/mailman/testing/layers.py
index 2d2552f93..eb51e309f 100644
--- a/src/mailman/testing/layers.py
+++ b/src/mailman/testing/layers.py
@@ -1,4 +1,4 @@
-# Copyright (C) 2008-2013 by the Free Software Foundation, Inc.
+# Copyright (C) 2008-2014 by the Free Software Foundation, Inc.
#
# This file is part of GNU Mailman.
#
diff --git a/src/mailman/testing/mailman-xx.po b/src/mailman/testing/mailman-xx.po
index 4945eb779..a1351b6e3 100644
--- a/src/mailman/testing/mailman-xx.po
+++ b/src/mailman/testing/mailman-xx.po
@@ -1,5 +1,5 @@
# Test catalog for Freedonia (xx)
-# Copyright (C) 2011-2013 by the Free Software Foundation, Inc.
+# Copyright (C) 2011-2014 by the Free Software Foundation, Inc.
msgid ""
msgstr ""
"Project-Id-Version: mailman\n"
diff --git a/src/mailman/testing/mta.py b/src/mailman/testing/mta.py
index 5349d2b62..7481e0093 100644
--- a/src/mailman/testing/mta.py
+++ b/src/mailman/testing/mta.py
@@ -1,4 +1,4 @@
-# Copyright (C) 2009-2013 by the Free Software Foundation, Inc.
+# Copyright (C) 2009-2014 by the Free Software Foundation, Inc.
#
# This file is part of GNU Mailman.
#
diff --git a/src/mailman/testing/nose.py b/src/mailman/testing/nose.py
index 8ac85a756..8fe7017c0 100644
--- a/src/mailman/testing/nose.py
+++ b/src/mailman/testing/nose.py
@@ -1,4 +1,4 @@
-# Copyright (C) 2013 by the Free Software Foundation, Inc.
+# Copyright (C) 2013-2014 by the Free Software Foundation, Inc.
#
# This file is part of GNU Mailman.
#
@@ -67,15 +67,19 @@ class NosePlugin(Plugin):
return
# Does the pattern match the fully qualified class name?
for pattern in self.patterns:
- full_name = '{}.{}'.format(
+ full_class_name = '{}.{}'.format(
event.testCase.__module__, event.testCase.__name__)
- if re.search(pattern, full_name):
+ if re.search(pattern, full_class_name):
# Don't suppress this test class.
return
names = filter(event.isTestMethod, dir(event.testCase))
for name in names:
+ full_test_name = '{}.{}.{}'.format(
+ event.testCase.__module__,
+ event.testCase.__name__,
+ name)
for pattern in self.patterns:
- if re.search(pattern, name):
+ if re.search(pattern, full_test_name):
break
else:
event.excludedNames.append(name)
diff --git a/src/mailman/testing/testing.cfg b/src/mailman/testing/testing.cfg
index 2c38322d5..fc76aa361 100644
--- a/src/mailman/testing/testing.cfg
+++ b/src/mailman/testing/testing.cfg
@@ -1,4 +1,4 @@
-# Copyright (C) 2008-2013 by the Free Software Foundation, Inc.
+# Copyright (C) 2008-2014 by the Free Software Foundation, Inc.
#
# This file is part of GNU Mailman.
#