'L{site.getSession} generates L{Session} objects with distinct UIDs from
a secure source of entropy.'

def test_sessionUIDGeneration(self):

    site = server.Site(resource.Resource())
    self.assertIdentical(site._entropy, os.urandom)
    def predictableEntropy(n):
        predictableEntropy.x += 1
        return (unichr(predictableEntropy.x) * n).encode('charmap')
    predictableEntropy.x = 0
    self.patch(site, '_entropy', predictableEntropy)
    a = self.getAutoExpiringSession(site)
    b = self.getAutoExpiringSession(site)
    self.assertEqual(a.uid, ('01' * 32))
    self.assertEqual(b.uid, ('02' * 32))
    self.assertEqual(site.counter, 2)
