MCPcopy Index your code
hub / github.com/RustPython/RustPython / test_bad_params

Method test_bad_params

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

Source from the content-addressed store, hash-verified

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