rough cleanup of component manager
[sfa.git] / tests / testCert.py
old mode 100644 (file)
new mode 100755 (executable)
index 68b3d11..b2e8133
@@ -1,6 +1,6 @@
 import unittest
-import xmlrpclib
-from cert import *
+from sfa.trust.certificate import Certificate, Keypair
+from sfa.util.py23 import xmlrpc_client
 
 class TestCert(unittest.TestCase):
    def setUp(self):
@@ -42,7 +42,7 @@ class TestCert(unittest.TestCase):
       # try something a bit more complicated, like an xmlrpc encoding of
       # some parameters
       cert = Certificate(subject="test")
-      data = xmlrpclib.dumps((1, "foo", ["a", "b"], {"c": "d", "e": "f"}, True))
+      data = xmlrpc_client.dumps((1, "foo", ["a", "b"], {"c": "d", "e": "f"}, True))
       cert.set_data(data)
       self.assertEqual(cert.get_data(), data)
 
@@ -185,14 +185,14 @@ class TestCert(unittest.TestCase):
       self.assert_(cert2.is_signed_by_cert(cert1))
       self.assert_(cert3.is_signed_by_cert(cert2))
 
-      self.assert_(cert3.verify_chain([cert_root]))
+      cert3.verify_chain([cert_root])
 
       # now save the chain to a string and load it into a new certificate
       str_chain = cert3.save_to_string(save_parents=True)
       cert4 = Certificate(string = str_chain)
 
       # verify the newly loaded chain still verifies
-      self.assert_(cert4.verify_chain([cert_root]))
+      cert4.verify_chain([cert_root])
 
       # verify the parentage
       self.assertEqual(cert4.get_parent().get_subject(), "two")