Be sure the temporary directory exists

This commit is contained in:
Jean-Paul Calderone 2020-11-18 16:53:38 -05:00
parent 5b0d20c453
commit 92691c1b32

View File

@ -6,6 +6,9 @@ import treq
from bs4 import BeautifulSoup from bs4 import BeautifulSoup
from twisted.python.filepath import (
FilePath,
)
from twisted.application import service from twisted.application import service
from twisted.internet import defer from twisted.internet import defer
from twisted.internet.defer import inlineCallbacks, returnValue from twisted.internet.defer import inlineCallbacks, returnValue
@ -316,10 +319,12 @@ class WebMixin(TimezoneMixin):
self.staticdir = self.mktemp() self.staticdir = self.mktemp()
self.clock = Clock() self.clock = Clock()
self.fakeTime = 86460 # 1d 0h 1m 0s self.fakeTime = 86460 # 1d 0h 1m 0s
tempdir = FilePath(self.mktemp())
tempdir.makedirs()
self.ws = webish.WebishServer( self.ws = webish.WebishServer(
self.s, self.s,
"0", "0",
tempdir=self.mktemp(), tempdir=tempdir.path,
staticdir=self.staticdir, staticdir=self.staticdir,
clock=self.clock, clock=self.clock,
now_fn=lambda:self.fakeTime, now_fn=lambda:self.fakeTime,