import sys, unittest from pathlib import Path sys.path.insert(0,str(Path(__file__).resolve().parents[1]/'scripts')) from sync import check class TestData(unittest.TestCase): def test_array(self): self.assertIsInstance(check(b'[{"id":"ALSA-2025:1"}]'),list) def test_error_html(self): with self.assertRaises(Exception): check(b'Bad Gateway') def test_empty(self): with self.assertRaises(ValueError): check(b'[]') if __name__=='__main__':unittest.main()