diff options
| author | Emmanuel Raviart <eraviart@entrouvert.com> | 2004-08-28 07:25:23 +0000 |
|---|---|---|
| committer | Emmanuel Raviart <eraviart@entrouvert.com> | 2004-08-28 07:25:23 +0000 |
| commit | e7e4d55ce5e3043b693296d9ce29ecaf8fdc80cb (patch) | |
| tree | f7041953b5bdbd03a597f8f2aa572bb2c2448843 /python/tests | |
| parent | 8425480fb7bf6906c970a75c13826da480ae46e1 (diff) | |
| download | lasso-e7e4d55ce5e3043b693296d9ce29ecaf8fdc80cb.tar.gz lasso-e7e4d55ce5e3043b693296d9ce29ecaf8fdc80cb.tar.xz lasso-e7e4d55ce5e3043b693296d9ce29ecaf8fdc80cb.zip | |
Renamed login_tests.py to profiles_tests.py.
Added Server tests (=> discovered bug #265).
Diffstat (limited to 'python/tests')
| -rwxr-xr-x[-rw-r--r--] | python/tests/profiles_tests.py (renamed from python/tests/login_tests.py) | 39 | ||||
| -rwxr-xr-x | python/tests/tests.py | 2 |
2 files changed, 36 insertions, 5 deletions
diff --git a/python/tests/login_tests.py b/python/tests/profiles_tests.py index a7ac8cd2..4e367ad7 100644..100755 --- a/python/tests/login_tests.py +++ b/python/tests/profiles_tests.py @@ -42,6 +42,36 @@ except NameError: dataDir = '../../tests/data' +class ServerTestCase(unittest.TestCase): + def test01(self): + """Server construction, dump & new_from_dump.""" + + lassoServer = lasso.Server( + os.path.join(dataDir, 'sp1-la/metadata.xml'), + None, # os.path.join(dataDir, 'sp1-la/public-key.pem') is no more used + os.path.join(dataDir, 'sp1-la/private-key-raw.pem'), + os.path.join(dataDir, 'sp1-la/certificate.pem'), + lasso.signatureMethodRsaSha1) + lassoServer.add_provider( + os.path.join(dataDir, 'idp1-la/metadata.xml'), + os.path.join(dataDir, 'idp1-la/public-key.pem'), + os.path.join(dataDir, 'idp1-la/certificate.pem')) + dump = lassoServer.dump() + lassoServer2 = lassoServer.new_from_dump(dump) + dump2 = lassoServer2.dump() + self.failUnlessEqual(dump, dump2) + + def test02(self): + """Server construction without argument, dump & new_from_dump.""" + + lassoServer = lasso.Server() + lassoServer.add_provider(os.path.join(dataDir, 'idp1-la/metadata.xml')) + dump = lassoServer.dump() + lassoServer2 = lassoServer.new_from_dump(dump) + dump2 = lassoServer2.dump() + self.failUnlessEqual(dump, dump2) + + class LoginTestCase(unittest.TestCase): def test01(self): """SP login; testing access to authentication request.""" @@ -127,11 +157,12 @@ class DefederationTestCase(unittest.TestCase): self.fail('Defederation process_notification_msg should have failed.') -suite1 = unittest.makeSuite(LoginTestCase, 'test') -suite2 = unittest.makeSuite(LogoutTestCase, 'test') -suite3 = unittest.makeSuite(DefederationTestCase, 'test') +suite1 = unittest.makeSuite(ServerTestCase, 'test') +suite2 = unittest.makeSuite(LoginTestCase, 'test') +suite3 = unittest.makeSuite(LogoutTestCase, 'test') +suite4 = unittest.makeSuite(DefederationTestCase, 'test') -allTests = unittest.TestSuite((suite1, suite2, suite3)) +allTests = unittest.TestSuite((suite1, suite2, suite3, suite4)) if __name__ == '__main__': sys.exit(not unittest.TextTestRunner(verbosity = 2).run(allTests).wasSuccessful()) diff --git a/python/tests/tests.py b/python/tests/tests.py index a1913e01..de3cf808 100755 --- a/python/tests/tests.py +++ b/python/tests/tests.py @@ -41,7 +41,7 @@ if not '../.libs' in sys.path: testSuites = ( - 'login_tests', + 'profiles_tests', 'errorchecking_tests', ) |
