A test case for proofofwork module with simple test for empty cpow

This commit is contained in:
Dmitri Bogomolov 2021-03-17 16:05:15 +02:00
parent f6cb3ad016
commit 1fbded5d14
Signed by untrusted user: g1itch
GPG Key ID: 720A756F18DEED13

View File

@ -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])