(self)
| 11 | |
| 12 | @unittest.skipUnless(has_symlink, "No symlink support") |
| 13 | def test_existing_symlink(self): |
| 14 | |
| 15 | with open(os.path.join(self.site.static_path, 'file.js'), "w") as f: |
| 16 | f.write("hello") |
| 17 | |
| 18 | os.symlink( |
| 19 | os.path.join(self.site.static_path, 'file.js'), |
| 20 | os.path.join(self.site.static_path, 'file-link.js')) |
| 21 | |
| 22 | self.site.build() |
| 23 | |
| 24 | self.assertFileExists(os.path.join(self.site.build_path, 'static', 'file.js')) |
| 25 | self.assertFileExists(os.path.join(self.site.build_path, 'static', 'file-link.js')) |
| 26 | |
| 27 | with open(os.path.join(self.site.build_path, 'static', 'file-link.js')) as f: |
| 28 | self.assertEqual(f.read(), "hello") |
| 29 | |
| 30 | self.assertEqual( |
| 31 | os.path.islink(os.path.join(self.site.build_path, 'static', 'file-link.js')), False) |
| 32 | |
| 33 | @unittest.skipUnless(has_symlink, "No symlink support") |
| 34 | def test_nonexisting_symlink(self): |
nothing calls this directly
no test coverage detected