[Zodb-checkins] CVS: ZODB3/ZEO/tests - testAuth.py:1.5

Christian Reis kiko at async.com.br
Tue Dec 23 07:06:30 EST 2003


Update of /cvs-repository/ZODB3/ZEO/tests
In directory cvs.zope.org:/tmp/cvs-serv24280/tests

Modified Files:
	testAuth.py 
Log Message:
Adding a simple test for the zeopasswd script. Modifies zeopasswd.main()                    slightly to accept a Database class; this is used only because                              auth_plaintext isn't an "officially supported" authentication protocol.


=== ZODB3/ZEO/tests/testAuth.py 1.4 => 1.5 ===
--- ZODB3/ZEO/tests/testAuth.py:1.4	Thu Oct  2 14:17:21 2003
+++ ZODB3/ZEO/tests/testAuth.py	Tue Dec 23 07:06:29 2003
@@ -21,6 +21,7 @@
 import zLOG
 
 from ThreadedAsync import LoopCallback
+from ZEO import zeopasswd
 from ZEO.ClientStorage import ClientStorage
 from ZEO.Exceptions import ClientDisconnected
 from ZEO.StorageServer import StorageServer
@@ -44,8 +45,19 @@
             self.pwdb = self.dbclass(self.pwfile)
         self.pwdb.add_user("foo", "bar")
         self.pwdb.save()
+        self._checkZEOpasswd()
         self.__super_setUp()
 
+    def _checkZEOpasswd(self):
+        args = ["-f", self.pwfile, "-p", self.protocol]
+        if self.protocol == "plaintext":
+            from ZEO.auth.base import Database
+            zeopasswd.main(args + ["-d", "foo"], Database)
+            zeopasswd.main(args + ["foo", "bar"], Database)
+        else:
+            zeopasswd.main(args + ["-d", "foo"])
+            zeopasswd.main(args + ["foo", "bar"])
+
     def tearDown(self):
         self.__super_tearDown()
         os.remove(self.pwfile)
@@ -101,6 +113,7 @@
         self._storage._connection._SizedMessageAsyncConnection__hmac_send = None
         # Once the client stops using the hmac, it should be disconnected.
         self.assertRaises(ClientDisconnected, self._storage.versions)
+
 
 class PlainTextAuth(AuthTest):
     import ZEO.tests.auth_plaintext




More information about the Zodb-checkins mailing list