16 lines
427 B
Python
16 lines
427 B
Python
import unittest
|
|
from block import __main__
|
|
|
|
class TestBlock(unittest.TestCase):
|
|
|
|
def test_main_success(self):
|
|
result = __main__(probability=0.20269478857517242)
|
|
self.assertEqual(result, {"grade": "A1"})
|
|
|
|
def test_main_invalid_input(self):
|
|
with self.assertRaises(ValueError):
|
|
__main__(probability="0.20") # Invalid input type (string)
|
|
|
|
if __name__ == "__main__":
|
|
unittest.main()
|