test_comparator.py 451 B

1234567891011121314151617
  1. """Base tests for comparator tool"""
  2. import binascii
  3. import inspect
  4. import unittest
  5. from module import MethodHolder
  6. class BaseTest(unittest.TestCase):
  7. EXPECTED_CRC32 = 2895804925
  8. def test_can_get_method_source(self):
  9. method = MethodHolder().call_me
  10. method_source_code = inspect.getsource(method)
  11. method_crc32 = binascii.crc32(method_source_code.encode())
  12. self.assertEqual(method_crc32, self.EXPECTED_CRC32)