From 09f6034f2f3185c74d4a34aefa7fccb5f88e7ec8 Mon Sep 17 00:00:00 2001 From: Lex Berezhny Date: Thu, 24 Oct 2019 23:54:22 -0400 Subject: [PATCH] added back prefix argument to create_upload_file fixture method --- lbry/lbry/testcase.py | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/lbry/lbry/testcase.py b/lbry/lbry/testcase.py index 4017b513d..704a66914 100644 --- a/lbry/lbry/testcase.py +++ b/lbry/lbry/testcase.py @@ -211,8 +211,8 @@ class CommandTestCase(IntegrationTestCase): await self.ledger.wait(tx) return self.sout(tx) - def create_upload_file(self, data, suffix=""): - file_path = tempfile.mktemp(prefix="tmp", suffix=suffix or "", dir=self.daemon.conf.upload_dir) + def create_upload_file(self, data, prefix=None, suffix=None): + file_path = tempfile.mktemp(prefix=prefix or "tmp", suffix=suffix or "", dir=self.daemon.conf.upload_dir) with open(file_path, 'w+b') as file: file.write(data) file.flush() @@ -220,16 +220,17 @@ class CommandTestCase(IntegrationTestCase): async def stream_create( self, name='hovercraft', bid='1.0', file_path=None, - data=b'hi!', confirm=True, suffix=None, **kwargs): + data=b'hi!', confirm=True, prefix=None, suffix=None, **kwargs): if file_path is None: - file_path = self.create_upload_file(data=data, suffix=suffix) + file_path = self.create_upload_file(data=data, prefix=prefix, suffix=suffix) return await self.confirm_and_render( self.daemon.jsonrpc_stream_create(name, bid, file_path=file_path, **kwargs), confirm ) - async def stream_update(self, claim_id, data=None, suffix=None, confirm=True, **kwargs): + async def stream_update( + self, claim_id, data=None, prefix=None, suffix=None, confirm=True, **kwargs): if data is not None: - file_path = self.create_upload_file(data=data, suffix=suffix) + file_path = self.create_upload_file(data=data, prefix=prefix, suffix=suffix) return await self.confirm_and_render( self.daemon.jsonrpc_stream_update(claim_id, file_path=file_path, **kwargs), confirm )