(self, tmp_path)
| 217 | assert_(invalidfile != ds.abspath(tmpfile)) |
| 218 | |
| 219 | def test_sandboxing(self, tmp_path): |
| 220 | ds = datasource.DataSource(tmp_path) |
| 221 | tmpfile = valid_textfile(tmp_path) |
| 222 | tmpfilename = os.path.split(tmpfile)[-1] |
| 223 | |
| 224 | path = lambda x: os.path.abspath(ds.abspath(x)) |
| 225 | |
| 226 | assert_(path(valid_httpurl()).startswith(str(tmp_path))) |
| 227 | assert_(path(invalid_httpurl()).startswith(str(tmp_path))) |
| 228 | assert_(path(tmpfile).startswith(str(tmp_path))) |
| 229 | assert_(path(tmpfilename).startswith(str(tmp_path))) |
| 230 | for fn in malicious_files: |
| 231 | assert_(path(http_path + fn).startswith(str(tmp_path))) |
| 232 | assert_(path(fn).startswith(str(tmp_path))) |
| 233 | |
| 234 | def test_windows_os_sep(self, tmp_path): |
| 235 | orig_os_sep = os.sep |
no test coverage detected