Index: main/waeup.ikoba/trunk/src/waeup/ikoba/utils/tests/test_idgen.py
===================================================================
--- main/waeup.ikoba/trunk/src/waeup/ikoba/utils/tests/test_idgen.py	(revision 12254)
+++ main/waeup.ikoba/trunk/src/waeup/ikoba/utils/tests/test_idgen.py	(revision 12254)
@@ -0,0 +1,48 @@
+import re
+import unittest
+from zope.component import queryUtility
+from zope.interface.verify import verifyClass, verifyObject
+from waeup.ikoba.testing import FunctionalLayer, FunctionalTestCase
+from waeup.ikoba.idgen import IIDSource, IDSource
+
+
+# format of raw uuids (36 chars including 4 hyphens)
+RE_FORMAT_UUID = re.compile(
+    "^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"
+    )
+
+# format of hex uuids (32 chars)
+RE_FORMAT_HEX_UUID = re.compile("^[0-9a-f]{32}$")
+
+
+class IDGeneratorTests(unittest.TestCase):
+
+    def test_iface(self):
+        # we fullfill any interface contracts
+        src = IDSource()
+        verifyClass(IIDSource, IDSource)
+        verifyObject(IIDSource, src)
+
+    def test_get_uuid(self):
+        # we can get universally unique identifiers
+        src = IDSource()
+        result = src.get_uuid()
+        assert(RE_FORMAT_UUID.match(result))
+        assert src.get_uuid() != result
+
+    def test_get_hex_uuid(self):
+        # we can get UUIDs as hex strings
+        src = IDSource()
+        result = src.get_hex_uuid()
+        assert (RE_FORMAT_HEX_UUID.match(result))
+        assert src.get_hex_uuid() != result
+
+
+class FunctionalIDSourceTests(FunctionalTestCase):
+
+    layer = FunctionalLayer
+
+    def test_IIDSource_utility_registered(self):
+        # an IIDSource is registered on startup
+        util = queryUtility(IIDSource)
+        assert util is not None
