[Zope-Checkins] CVS: Zope3/lib/python/Zope/App/Security/tests - testBasicAuthAdapter.py:1.1.2.2 testZope3RoleManagement.py:NONE

Guido van Rossum guido@python.org
Thu, 13 Dec 2001 15:23:40 -0500


Update of /cvs-repository/Zope3/lib/python/Zope/App/Security/tests
In directory cvs.zope.org:/tmp/cvs-serv20277

Modified Files:
      Tag: Zope-3x-branch
	testBasicAuthAdapter.py 
Removed Files:
      Tag: Zope-3x-branch
	testZope3RoleManagement.py 
Log Message:
Deleting non-functional tests.

=== Zope3/lib/python/Zope/App/Security/tests/testBasicAuthAdapter.py 1.1.2.1 => 1.1.2.2 ===
 from Zope.App.Security.BasicAuthAdapter import BasicAuthAdapter
 
+class Request:
+
+    def __init__(self, lpw):
+        self.lpw = lpw
+
+    def _authUserPW(self):
+        return self.lpw
+
+    challenge = None
+    def unauthorized(self, challenge):
+        self.challenge = challenge
+
+
 class Test(unittest.TestCase):
 
     def testBasicAuthAdapter(self):
-        class Request:
-            def __init__(self, lpw):
-                self.lpw = lpw
-            def _authUserPW(self):
-                return self.lpw
         r = Request(None)
         a = BasicAuthAdapter(r)
         self.assertEqual(a.getLogin(), None)
@@ -29,6 +37,9 @@
         a = BasicAuthAdapter(r)
         self.assertEqual(a.getLogin(), "tim")
         self.assertEqual(a.getPassword(), "123")
+
+    def testUnauthorized(self):
+        r = Request(None)
 
 def test_suite():
     loader=unittest.TestLoader()

=== Removed File Zope3/lib/python/Zope/App/Security/tests/testZope3RoleManagement.py ===