upleb.uk

Public git repos — served from a NIP-34 GRASP relay at git.upleb.uk

summaryrefslogtreecommitdiff
path: root/tests/test_rbf0_encode.py
diff options
context:
space:
mode:
Diffstat (limited to 'tests/test_rbf0_encode.py')
-rw-r--r--tests/test_rbf0_encode.py10
1 files changed, 10 insertions, 0 deletions
diff --git a/tests/test_rbf0_encode.py b/tests/test_rbf0_encode.py
index 56c135d9b..ee44e7923 100644
--- a/tests/test_rbf0_encode.py
+++ b/tests/test_rbf0_encode.py
@@ -280,6 +280,16 @@ class Cli(unittest.TestCase):
280 self.run_main(report, out_dir) 280 self.run_main(report, out_dir)
281 self.assertFalse(os.path.exists(out_dir)) 281 self.assertFalse(os.path.exists(out_dir))
282 282
283 def test_non_utf8_report_is_one_line_error(self):
284 report = os.path.join(self.tmp.name, "binary.json")
285 with open(report, "wb") as f:
286 f.write(b"\xff\xfe{\x80")
287 out_dir = os.path.join(self.tmp.name, "out-binary")
288 with self.assertRaises(SystemExit) as cm:
289 self.run_main(report, out_dir)
290 self.assertIn("cannot read report", str(cm.exception))
291 self.assertFalse(os.path.exists(out_dir))
292
283 def test_write_all_handles_non_int_offset_and_non_dict_resource(self): 293 def test_write_all_handles_non_int_offset_and_non_dict_resource(self):
284 doc = rbf0_tree.parse_resource(every_record(True)) 294 doc = rbf0_tree.parse_resource(every_record(True))
285 doc["offset"] = "0x100" 295 doc["offset"] = "0x100"