15 lines
416 B
Python
15 lines
416 B
Python
import unittest
|
|
from block import __main__
|
|
|
|
class TestBlock(unittest.TestCase):
|
|
|
|
def test_main_success(self):
|
|
result = __main__(probability=0.2707298696)
|
|
self.assertEqual(result, {"bin": "1"})
|
|
|
|
def test_main_invalid_input(self):
|
|
with self.assertRaises(ValueError):
|
|
__main__(probability="0.27") # Invalid input type (string)
|
|
|
|
if __name__ == "__main__":
|
|
unittest.main() |