add Gpu skip condition and setupclass in test_openclpow module

This commit is contained in:
navjot 2021-01-20 00:12:43 +05:30
parent 1612f9c778
commit 7b8bf082ff
No known key found for this signature in database
GPG Key ID: 9EE70AFD71357F1C

View File

@ -8,17 +8,23 @@ import pybitmessage.openclpow as openclpow
from struct import pack, unpack
from test_process import TestProcessProto
class TestOpenClPow(unittest.TestCase):
class TestOpenClPow(TestProcessProto):
Main opencl test case
@unittest.skipIf(not openclpow.libAvailable,
"pyopencl is not installed")
def setUpClass(cls):
super(TestOpenClPow, cls).setUpClass()
@unittest.skipIf(not openclpow.enabledGpus,
"No GPUs found / enabled")
def test_openclpow(self):
"""Check the working of openclpow module"""
target_ = 54227212183
initialHash = ("3758f55b5a8d902fd3597e4ce6a2d3f23daff735f65d9698c270987f4e67ad590"