Skip to content
Snippets Groups Projects
Commit dcd0f031 authored by alexey.stratulat's avatar alexey.stratulat
Browse files

[+] Made UnitTest which checks initialization, and library deinitialization,...

[+] Made UnitTest which checks initialization, and library deinitialization, and also checks the operation of the base58 and base64 algorithm
parent 6db1e612
No related branches found
No related tags found
1 merge request!26Support 3689
......@@ -4,3 +4,6 @@
[submodule "libdap"]
path = libdap
url = https://github.com/cellframe/libdap.git
[submodule "test/libdap-python"]
path = test/libdap-python
url = https://github.com/cellframe/libdap-python.git
Subproject commit e8d7f4e84f0cbca515236f317e9aa5d079df1962
import libdap_crypto_python_module as crypto
import unittest
class TestLibdapCryptoPythonModule(unittest.TestCase):
def test_ini(self):
self.assertTrue(crypto.init() == 0, "Failed init libdap crypto python")
def test_deinit(self):
self.assertTrue(crypto.deinit() == 0, "Failed deinit libdap crypto python")
def test_b58(self):
s = "REvgshguqwt76thuioh1`lwi0-8i-d0hjwpeocnpgh89efty7ug"
crypt = crypto.encode_base58(s)
decrypt = crypto.decode_base58(crypt)
self.assertTrue(s == decrypt, "Encoding and decoded information using the base58 algorithm does not match the original")
def test_b64(self):
s = "LindyfekrngFHJFGR23356fer"
crypt = crypto.encode_base64(s)
decrypt = crypto.decode_base64(crypt, len(s))
self.assertTrue(s == decrypt, "Encoding and decoded information using the base64 algorithm does not match the original")
if __name__ == '__main__':
unittest.main()
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment