Revert last change

This commit is contained in:
Miroslav Kovar 2019-10-16 21:48:30 +02:00 committed by Lex Berezhny
parent e29688530d
commit 2737b3635f

View file

@ -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):