Skip to content
Snippets Groups Projects
Commit 2b7f9ad0 authored by pompolic's avatar pompolic
Browse files

Progress towards unit tests

parent 9bbdb27d
No related branches found
No related tags found
No related merge requests found
import unittest import unittest
import unittest.mock import unittest.mock
class HParseResultCreation(unittest.TestCase):
mocked_hparseresult = None
@classmethod
def setUpClass(cls):
hpt_patcher = unittest.mock.patch('__main__.HParsedToken', autospec=True)
gdbv_patcher = unittest.mock.patch('gdb.Value', autospec=True)
hpt_patcher.start()
gdbv_patcher.start()
mocked_hparseresult = HParseResult(0xdeadbeef)
gdbv_patcher.stop()
hpt_patcher.stop()
#def test_valid_address(self):
# raise ValueError
def test_nullpointer(self):
with self.assertRaises(ValueError):
res = HParseResult(0)
#@patch("HParsedToken")
#def test_make_HParsedToken(self):
# with patch.object(HParseResult, "read_member", return_value=0xdeadbeef):
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment