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