(self)
| 224 | assert_(invalidfile != self.ds.abspath(tmpfile)) |
| 225 | |
| 226 | def test_sandboxing(self): |
| 227 | tmpfile = valid_textfile(self.tmpdir) |
| 228 | tmpfilename = os.path.split(tmpfile)[-1] |
| 229 | |
| 230 | tmp_path = lambda x: os.path.abspath(self.ds.abspath(x)) |
| 231 | |
| 232 | assert_(tmp_path(valid_httpurl()).startswith(self.tmpdir)) |
| 233 | assert_(tmp_path(invalid_httpurl()).startswith(self.tmpdir)) |
| 234 | assert_(tmp_path(tmpfile).startswith(self.tmpdir)) |
| 235 | assert_(tmp_path(tmpfilename).startswith(self.tmpdir)) |
| 236 | for fn in malicious_files: |
| 237 | assert_(tmp_path(http_path+fn).startswith(self.tmpdir)) |
| 238 | assert_(tmp_path(fn).startswith(self.tmpdir)) |
| 239 | |
| 240 | def test_windows_os_sep(self): |
| 241 | orig_os_sep = os.sep |
no test coverage detected