gdown icon indicating copy to clipboard operation
gdown copied to clipboard

Fix tests for Windows

Open RunDevelopment opened this issue 1 year ago • 2 comments

Fixes #313.

Changes:

  • Removed all uses of shlex.split. Since windows paths use \, string interpolation + shlex.split will result in those backslashes being interpreted as escape sequences. So I used argument arrays everywhere instead.
  • Removed the assumption that /tmp is a directory that exists.
  • Removed usage of tempfile.NamedTemporaryFile(). The named file is opened by the test process, which means that it cannot be written to by a sub process on windows.
  • Added GH CI job for tests with Windows test runner. Since make doesn't exist on Windows, I copied the test command.

RunDevelopment avatar Feb 03 '24 19:02 RunDevelopment

Right now, all tests pass on Windows except for test_download_folder_from_gdrive. I have no idea what this command does, so I can't replace it with equivalent python code.

RunDevelopment avatar Feb 03 '24 19:02 RunDevelopment

@RunDevelopment Now I added CI for Windows that uses make command with : https://github.com/wkentaro/gdown/pull/324

I'll work on updating the tests next.

wkentaro avatar Feb 11 '24 15:02 wkentaro