MCPcopy
hub / github.com/numpy/numpy / test_sandboxing

Method test_sandboxing

numpy/lib/tests/test__datasource.py:256–262  ·  view source on GitHub ↗
(self, tmp_path)

Source from the content-addressed store, hash-verified

254 assert_equal(local_path, filepath)
255
256 def test_sandboxing(self, tmp_path):
257 repos = datasource.Repository(valid_baseurl(), tmp_path)
258 path = lambda x: os.path.abspath(repos.abspath(x))
259 assert_(path(valid_httpfile()).startswith(str(tmp_path)))
260 for fn in malicious_files:
261 assert_(path(http_path + fn).startswith(str(tmp_path)))
262 assert_(path(fn).startswith(str(tmp_path)))
263
264 def test_windows_os_sep(self, tmp_path):
265 orig_os_sep = os.sep

Callers 1

test_windows_os_sepMethod · 0.95

Calls 6

abspathMethod · 0.95
assert_Function · 0.90
valid_baseurlFunction · 0.85
valid_httpfileFunction · 0.85
startswithMethod · 0.80
abspathMethod · 0.45

Tested by

no test coverage detected