Merge pull request #2589 from oulenz/test_server

Replace `os.mknod` with `open` for macOS and Windows compatibility
This commit is contained in:
Justin Mayer 2019-07-03 23:36:39 +02:00 committed by GitHub
commit 7c63cb5231
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -35,12 +35,12 @@ class TestServer(unittest.TestCase):
self.server)
handler.base_path = self.temp_output
os.mknod(os.path.join(self.temp_output, 'foo.html'))
open(os.path.join(self.temp_output, 'foo.html'), 'a').close()
os.mkdir(os.path.join(self.temp_output, 'foo'))
os.mknod(os.path.join(self.temp_output, 'foo', 'index.html'))
open(os.path.join(self.temp_output, 'foo', 'index.html'), 'a').close()
os.mkdir(os.path.join(self.temp_output, 'bar'))
os.mknod(os.path.join(self.temp_output, 'bar', 'index.html'))
open(os.path.join(self.temp_output, 'bar', 'index.html'), 'a').close()
os.mkdir(os.path.join(self.temp_output, 'baz'))