summaryrefslogtreecommitdiff
path: root/src/mailman/pipeline/tests/test_scrubber.py
diff options
context:
space:
mode:
authorBarry Warsaw2012-03-05 13:27:14 -0500
committerBarry Warsaw2012-03-05 13:27:14 -0500
commit5350f4875fbe65055d045c44cfd2d4348cfeb5ec (patch)
tree3b7cab54b213844252decae19921022fde46f25a /src/mailman/pipeline/tests/test_scrubber.py
parentf44d4e86d6c43f90268fcf3e0636212faf09578d (diff)
downloadmailman-5350f4875fbe65055d045c44cfd2d4348cfeb5ec.tar.gz
mailman-5350f4875fbe65055d045c44cfd2d4348cfeb5ec.tar.zst
mailman-5350f4875fbe65055d045c44cfd2d4348cfeb5ec.zip
Diffstat (limited to 'src/mailman/pipeline/tests/test_scrubber.py')
-rw-r--r--src/mailman/pipeline/tests/test_scrubber.py45
1 files changed, 45 insertions, 0 deletions
diff --git a/src/mailman/pipeline/tests/test_scrubber.py b/src/mailman/pipeline/tests/test_scrubber.py
new file mode 100644
index 000000000..7ac5eb855
--- /dev/null
+++ b/src/mailman/pipeline/tests/test_scrubber.py
@@ -0,0 +1,45 @@
+# Copyright (C) 2012 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/>.
+
+"""Scrubber module tests."""
+
+from __future__ import absolute_import, print_function, unicode_literals
+
+__metaclass__ = type
+__all__ = [
+ 'TestScrubber',
+ ]
+
+
+import unittest
+
+from mailman.pipeline import scrubber
+
+
+
+class TestScrubber(unittest.TestCase):
+ """Scrubber module tests."""
+
+ def test_guess_extension(self):
+ # A known extension should be found.
+ extension = scrubber.guess_extension('application/msword', '.doc')
+ self.assertEqual(extension, '.doc')
+
+ def test_guess_missing_extension(self):
+ # Maybe some other extension is better.
+ extension = scrubber.guess_extension('application/msword', '.xxx')
+ self.assertEqual(extension, '.doc')