npkpy/tests/cnt_squash_fs_hash_signature_test.py
2020-06-25 19:33:49 +02:00

19 lines
579 B
Python

import unittest
from npkpy.npk.cnt_squashfs_hash_signature import CntSquashFsHashSignature
from tests.constants import get_dummy_basic_cnt
class Test_cntSquashFsHashSignature(unittest.TestCase):
def setUp(self) -> None:
self.cnt = CntSquashFsHashSignature(get_dummy_basic_cnt(cnt_id=9), offset_in_pck=0)
def test_validateCntId(self):
self.assertEqual(9, self.cnt.cnt_id)
def test_giveOverviewOfCnt(self):
expected = "Payload[-10:]: b'Payload'"
_, cntData = self.cnt.output_cnt
self.assertEqual(expected, cntData[-1])