summaryrefslogtreecommitdiff
path: root/src/mailman/model/tests/test_uid.py
diff options
context:
space:
mode:
authorBarry Warsaw2011-04-22 19:26:43 -0400
committerBarry Warsaw2011-04-22 19:26:43 -0400
commitb5b015ce524157cfef4b795e4b0c7ff17b4d0fe2 (patch)
tree260169450ab382cf59143f0fe8bae0fc0507452f /src/mailman/model/tests/test_uid.py
parent6959e6adcb582172aeec01ef6b6a75b9ba85017b (diff)
downloadmailman-b5b015ce524157cfef4b795e4b0c7ff17b4d0fe2.tar.gz
mailman-b5b015ce524157cfef4b795e4b0c7ff17b4d0fe2.tar.zst
mailman-b5b015ce524157cfef4b795e4b0c7ff17b4d0fe2.zip
Diffstat (limited to 'src/mailman/model/tests/test_uid.py')
-rw-r--r--src/mailman/model/tests/test_uid.py48
1 files changed, 48 insertions, 0 deletions
diff --git a/src/mailman/model/tests/test_uid.py b/src/mailman/model/tests/test_uid.py
new file mode 100644
index 000000000..6f5cde4d2
--- /dev/null
+++ b/src/mailman/model/tests/test_uid.py
@@ -0,0 +1,48 @@
+# Copyright (C) 2011 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 UID model class."""
+
+from __future__ import absolute_import, unicode_literals
+
+__metaclass__ = type
+__all__ = [
+ 'test_suite',
+ ]
+
+
+import unittest
+
+from mailman.model.uid import UID
+from mailman.testing.layers import ConfigLayer
+
+
+
+class TestUID(unittest.TestCase):
+ layer = ConfigLayer
+
+ def test_record(self):
+ UID.record('abc')
+ UID.record('def')
+ self.assertRaises(ValueError, UID.record, 'abc')
+
+
+
+def test_suite():
+ suite = unittest.TestSuite()
+ suite.addTest(unittest.makeSuite(TestUID))
+ return suite