changeset 4236:97bffc03c15f

Test cases for UniqueIDGenerator (incomplete)
author Florian Krupicka <florian.krupicka@googlemail.com>
date Sun, 20 Jul 2008 18:32:36 +0200
parents a6c315ff8d66
children 162002d5b148
files MoinMoin/web/_tests/test_utils.py
diffstat 1 files changed, 27 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/MoinMoin/web/_tests/test_utils.py	Sun Jul 20 18:32:36 2008 +0200
@@ -0,0 +1,27 @@
+# -*- coding: utf-8 -*-
+"""
+    MoinMoin - MoinMoin.web.utils Tests
+
+    @copyright: 2008 MoinMoin:FlorianKrupicka
+    @license: GNU GPL, see COPYING for details.
+"""
+from MoinMoin.web import utils
+
+class TestUniqueIDGenerator(object):
+
+    def setup_method(self, method):
+        self.uid_gen = utils.UniqueIDGenerator('TestPage')
+
+    def testGeneration(self):
+        TESTCASES = [('somebase', 'somebase'), ('other', 'other'),
+                     ('somebase', 'somebase-1'), ('another', 'another'),
+                     ('other', 'other-1'), ('other', 'other-2'),
+                     ('somebase', 'somebase-2')]
+        for base, expected in TESTCASES:
+            assert self.uid_gen(base) == expected
+
+    def testStack(self):
+        raise NotImplementedError("TODO: needs implementation")
+
+    def testDocuments(self):
+        raise NotImplementedError("TODO: needs implementation")