(self)
| 407 | ) |
| 408 | |
| 409 | def test_strip_and_prepend(self): |
| 410 | fullpath = ["test", "build", "real", "path"] |
| 411 | path = os.path.join(self.directory, *fullpath) |
| 412 | os.makedirs(path) |
| 413 | script = script_helper.make_script(path, "test", "1 / 0") |
| 414 | bc = importlib.util.cache_from_source(script) |
| 415 | stripdir = os.path.join(self.directory, *fullpath[:2]) |
| 416 | prependdir = "/foo" |
| 417 | compileall.compile_dir(path, quiet=True, |
| 418 | stripdir=stripdir, prependdir=prependdir) |
| 419 | rc, out, err = script_helper.assert_python_failure(bc) |
| 420 | expected_in = os.path.join(prependdir, *fullpath[2:]) |
| 421 | self.assertIn( |
| 422 | expected_in, |
| 423 | str(err, encoding=sys.getdefaultencoding()) |
| 424 | ) |
| 425 | self.assertNotIn( |
| 426 | stripdir, |
| 427 | str(err, encoding=sys.getdefaultencoding()) |
| 428 | ) |
| 429 | |
| 430 | def test_strip_prepend_and_ddir(self): |
| 431 | fullpath = ["test", "build", "real", "path", "ddir"] |
nothing calls this directly
no test coverage detected