(self)
| 128 | self.recreation_check(b'\0\0\0\0') |
| 129 | |
| 130 | def test_compile_files(self): |
| 131 | # Test compiling a single file, and complete directory |
| 132 | for fn in (self.bc_path, self.bc_path2): |
| 133 | try: |
| 134 | os.unlink(fn) |
| 135 | except: |
| 136 | pass |
| 137 | self.assertTrue(compileall.compile_file(self.source_path, |
| 138 | force=False, quiet=True)) |
| 139 | self.assertTrue(os.path.isfile(self.bc_path) and |
| 140 | not os.path.isfile(self.bc_path2)) |
| 141 | os.unlink(self.bc_path) |
| 142 | self.assertTrue(compileall.compile_dir(self.directory, force=False, |
| 143 | quiet=True)) |
| 144 | self.assertTrue(os.path.isfile(self.bc_path) and |
| 145 | os.path.isfile(self.bc_path2)) |
| 146 | os.unlink(self.bc_path) |
| 147 | os.unlink(self.bc_path2) |
| 148 | # Test against bad files |
| 149 | self.add_bad_source_file() |
| 150 | self.assertFalse(compileall.compile_file(self.bad_source_path, |
| 151 | force=False, quiet=2)) |
| 152 | self.assertFalse(compileall.compile_dir(self.directory, |
| 153 | force=False, quiet=2)) |
| 154 | |
| 155 | def test_compile_file_pathlike(self): |
| 156 | self.assertFalse(os.path.isfile(self.bc_path)) |
nothing calls this directly
no test coverage detected