12 lines
493 B
Python
12 lines
493 B
Python
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'<html>Bad Gateway</html>')
|
|
def test_empty(self):
|
|
with self.assertRaises(ValueError): check(b'[]')
|
|
if __name__=='__main__':unittest.main()
|