MCPcopy Index your code
hub / github.com/python/cpython / test_bad_params

Method test_bad_params

Lib/test/test_zstd.py:2548–2563  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

2546 self.assertEqual(file_data.replace(os.linesep, "\n"), uncompressed * 2)
2547
2548 def test_bad_params(self):
2549 with tempfile.NamedTemporaryFile(delete=False) as tmp_f:
2550 TESTFN = pathlib.Path(tmp_f.name)
2551
2552 with self.assertRaises(ValueError):
2553 open(TESTFN, "")
2554 with self.assertRaises(ValueError):
2555 open(TESTFN, "rbt")
2556 with self.assertRaises(ValueError):
2557 open(TESTFN, "rb", encoding="utf-8")
2558 with self.assertRaises(ValueError):
2559 open(TESTFN, "rb", errors="ignore")
2560 with self.assertRaises(ValueError):
2561 open(TESTFN, "rb", newline="\n")
2562
2563 os.remove(TESTFN)
2564
2565 def test_option(self):
2566 options = {DecompressionParameter.window_log_max:25}

Callers

nothing calls this directly

Calls 3

openFunction · 0.90
assertRaisesMethod · 0.45
removeMethod · 0.45

Tested by

no test coverage detected