Revert last change
This commit is contained in:
parent
e29688530d
commit
2737b3635f
1 changed files with 12 additions and 4 deletions
|
@ -199,10 +199,18 @@ class CommandTestCase(IntegrationTestCase):
|
|||
|
||||
def create_tempfile(self, data=None, prefix=None, suffix=None, dir_path=None):
|
||||
dir_path = dir_path or self.daemon.conf.download_dir
|
||||
self.file = tempfile.NamedTemporaryFile(prefix=prefix, suffix=suffix, dir=dir_path)
|
||||
self.file.write(data)
|
||||
self.file.flush()
|
||||
return self.file.name
|
||||
file = tempfile.NamedTemporaryFile(prefix=prefix, suffix=suffix, dir=dir_path)
|
||||
file.write(data)
|
||||
file.flush()
|
||||
|
||||
def cleanup():
|
||||
try:
|
||||
file.close()
|
||||
except FileNotFoundError:
|
||||
pass
|
||||
|
||||
self.addCleanup(cleanup)
|
||||
return file.name
|
||||
|
||||
async def stream_create(self, name='hovercraft', bid='1.0', data=b'hi!', confirm=True,
|
||||
prefix=None, suffix=None, **kwargs):
|
||||
|
|
Loading…
Reference in a new issue