From 1fbded5d14ee8a115573e7aad305955c477b6e3c Mon Sep 17 00:00:00 2001 From: Dmitri Bogomolov <4glitch@gmail.com> Date: Wed, 17 Mar 2021 16:05:15 +0200 Subject: [PATCH] A test case for proofofwork module with simple test for empty cpow --- src/tests/test_proofofwork.py | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 src/tests/test_proofofwork.py diff --git a/src/tests/test_proofofwork.py b/src/tests/test_proofofwork.py new file mode 100644 index 00000000..567c201d --- /dev/null +++ b/src/tests/test_proofofwork.py @@ -0,0 +1,23 @@ +""" +Tests for proofofwork module +""" +import unittest + +from .common import skip_python3 + +skip_python3() # noqa:E402 + +from pybitmessage import proofofwork + + +class TestProofofwork(unittest.TestCase): + """The main test case for proofofwork""" + + @classmethod + def setUpClass(cls): + proofofwork.init() + + def test_empty(self): + """just reproducing the empty test from proofofwork.init()""" + self.assertEqual( + proofofwork._doCPoW(2**63, ""), [6485065370652060397, 4])