Commit 60d04954 authored by Tom Niget's avatar Tom Niget

Fix test

parent fe2f9697
...@@ -70,7 +70,7 @@ class TestRegistryClientInteract(unittest.TestCase): ...@@ -70,7 +70,7 @@ class TestRegistryClientInteract(unittest.TestCase):
self.fail("Request token failed, no token in database") self.fail("Request token failed, no token in database")
# token: tuple[unicode,] # token: tuple[unicode,]
token = str(token[0]) token = str(token[0])
self.assertEqual(client.isToken(token), b"1") self.assertEqual(client.isToken(token).decode(), "1")
# request ca # request ca
ca = client.getCa() ca = client.getCa()
...@@ -78,7 +78,7 @@ class TestRegistryClientInteract(unittest.TestCase): ...@@ -78,7 +78,7 @@ class TestRegistryClientInteract(unittest.TestCase):
# request a cert and get cn # request a cert and get cn
key, csr = tools.generate_csr() key, csr = tools.generate_csr()
cert = client.requestCertificate(token, csr) cert = client.requestCertificate(token, csr)
self.assertEqual(client.isToken(token), b'', "token should be deleted") self.assertEqual(client.isToken(token).decode(), '', "token should be deleted")
# creat x509.cert object # creat x509.cert object
def write_to_temp(text): def write_to_temp(text):
...@@ -97,7 +97,7 @@ class TestRegistryClientInteract(unittest.TestCase): ...@@ -97,7 +97,7 @@ class TestRegistryClientInteract(unittest.TestCase):
# verfiy cn and prefix # verfiy cn and prefix
prefix = client.cert.prefix prefix = client.cert.prefix
cn = client.getNodePrefix(email) cn = client.getNodePrefix(email).decode()
self.assertEqual(tools.prefix2cn(prefix), cn) self.assertEqual(tools.prefix2cn(prefix), cn)
# simulate the process in cache # simulate the process in cache
...@@ -108,7 +108,7 @@ class TestRegistryClientInteract(unittest.TestCase): ...@@ -108,7 +108,7 @@ class TestRegistryClientInteract(unittest.TestCase):
# no re6stnet, empty result # no re6stnet, empty result
bootpeer = client.getBootstrapPeer(prefix) bootpeer = client.getBootstrapPeer(prefix)
self.assertEqual(bootpeer, "") self.assertEqual(bootpeer.decode(), "")
# server should not die # server should not die
self.assertIsNone(self.server.proc.poll()) self.assertIsNone(self.server.proc.poll())
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment