Repository navigation
Fix functional tests failed (android, push_file) - #375
Conversation
| self.driver.quit() | ||
|
|
||
| # remove zipped file from `test_pull_folder` | ||
| if hasattr(self, 'zipfilename') and os.path.isfile(self.zipfilename): |
There was a problem hiding this comment.
if os.path.exists(getattr(self, 'zipfilename', ''))
|
|
||
| folder = self.driver.pull_folder(path) | ||
|
|
||
| # python doesn't have any functionality for unzipping streams |
There was a problem hiding this comment.
how about StringIO?
There was a problem hiding this comment.
I didn't know StringIO, it's super cool.
But for here, I couldn't create zipfile object(here is myzip) with StringIO object.
There was a problem hiding this comment.
hm, should be possible: https://stackoverflow.com/questions/10908877/extracting-a-zipfile-to-memory
There was a problem hiding this comment.
There was a problem hiding this comment.
Thanks so much, I did.
(I didn't take care of decoding for zipfile data...)
| self.assertEqual(data, data_ret) | ||
|
|
||
| def test_pull_folder(self): | ||
| string_data = b'random string data %d' % random.randint(0, 1000) |
There was a problem hiding this comment.
use '{}'.format(var) for formatting. After dropping python2 support I would use f'{var}' format
| self.assertEqual(original_data, new_data) | ||
|
|
||
|
|
||
| if __name__ == "__main__": |
There was a problem hiding this comment.
' (single quote) instead of " in this file?
There was a problem hiding this comment.
Yes.
I'll replace it in all cases at this PR.
|
|
||
| folder = self.driver.pull_folder(dest_dir) | ||
|
|
||
| filelist = ZipFile(BytesIO(base64.b64decode(folder))).namelist() |
There was a problem hiding this comment.
should we use ZipFile instance with with operator ?
For #373
Results