1
0
mirror of https://github.com/arsenetar/send2trash.git synced 2024-11-14 11:39:03 +00:00
Commit Graph

29 Commits

Author SHA1 Message Date
0ef9b3294a
fix(tests): Correct windows tests to run on python <3.6 2022-07-26 22:51:16 -05:00
4b9bc4bc31
fix(win): Prevent exception on empty list
Add check for when an empty list remains after preprocessing and do
not continue for both legacy and modern windows implementations.

Fix #71
2022-07-26 22:42:30 -05:00
d37197c4f7
Move mac/win to subpackages & fix #64
- Move macOS and Windows implementations to sub packagese to improve organization
- Fix #64 in legacy windows implementation by mapping results to standard error codes
2022-04-30 19:52:09 -05:00
2a88b82104
Fix test_plat_other from previous change 2021-08-24 01:21:12 -05:00
18e51c0b5a
Minor cleanup in plat_other
- Add OSError code values
- Use INFO_SUFFIX constant in tests
- Remove old PathLike conversions
2021-08-24 01:00:02 -05:00
7686647389
Fix flake8 error 2021-08-21 16:04:05 -05:00
696aed558b
Change method for test symlink path generation 2021-08-21 16:00:50 -05:00
007d84361a
Fix items missed in test_plat_other in last commit 2021-08-21 15:22:59 -05:00
78a536abba
Minor code quality updates 2021-08-21 15:19:32 -05:00
74f2dff57b
Add exception handling to file cleanup
- Surpress errors caused by long file cleanup in older python environments
2021-08-19 20:46:02 -05:00
d0e4890a4d
Black format updates with correct line length 2021-08-17 18:58:11 -05:00
10c7693d11
Minor fixes to tests 2021-03-17 21:51:51 -05:00
356509120b
Add some checks to catch test failure
Really just checking that the setup is able to create test files so it
is known they were there then removed.
Windows tests really need verification of
recycle, which is not present.
2021-03-17 20:52:16 -05:00
f9fcdb8d8c
Fix legacy windows platform for multibyte unicode
- Add handling to create correctly sized buffer even with multibyte
characters as len() in python does not line up with what
create_unicode_buffer() needs for length.
- Add test for single and multiple files
2021-03-10 21:41:30 -06:00
af0c1ba704
More test fixes
- Fix travis windows env
- Fix exception type in test_plat_win
- Finish converting tests in test_plat_other, fix exception type
2021-03-10 18:57:35 -06:00
9f76fbf036
Updates for tests on windows
- Other platform tests WIP
- Windows long directory tests WIP
2021-03-02 19:33:44 -06:00
dbdcce8b04
First batch of updates to unit tests
- Remove content from __init__.py
- Change test_script_main to use pytest
- Update test_script_main to run on windows as well as linux
2021-03-02 00:26:29 -06:00
Julian Gilbey
741c7ad51f Only import Windows-specific modules when on Windows 2021-01-29 05:42:11 +00:00
6ac20bc4f6
Fix new issues with unit tests
- Create custom test suite based on platform
- Use the custom suite for all tests
- Update tox.ini to install pywin32
2020-06-11 23:20:16 -05:00
e3d2be3243
Update windows tests to test both versions
This fixes #44 by testing the automatic import, the legacy version, and
the modern version directtly.
2020-06-11 22:42:00 -05:00
d078554052
Windows Performance Improvement & Multi-Item support (#43)
* Initial IFileOperation for Windows

- Try using IFileOperation instead of SHFileOperation
  - Use pywin32 to accomplish this
  - Implement fallback when pywin32 not available
- Handles paths like `C:\` just fine bu the `\\?\` paths in the test
  cause issue
- Add batching for IFileOperation version (performance)
- Minor formatting applied by editor

* Fix issue with paths starting with \\?\

- Strip these characters off if present just like old implementation

* Add windows version check, legacy list support

- Add check for windows version for IFileOperation
- Add list support to legacy version
- Remove some debugging code
- Fix bug in path converson

Not sure if there is a better way to layout this file

* Split plat_win into legacy and modern

* Update other platforms for list support

Formatter also ran on these so some other minor changes.

* Add unit tests for multi-file calls
2020-06-03 12:49:41 -04:00
Matthew D. Scholefield
9ede898c3e
Create __main__.py (Fixes #15) (#38)
This adds a main method that mimics the behavior of `rm`. It can be called via `python -m send2trash somefile`.
2020-05-27 07:52:00 -04:00
sharkykh
66afce7252 Fix silently failing on Windows (#33)
* Fix #31: Silently failing on Windows

* Update Windows test

* Fix test folders not getting removed
2019-04-30 12:28:09 -04:00
Virgil Dupras
74352462f5 Fix broken tests on py2 2018-07-26 08:30:39 -04:00
Mickaël Schoentgen
020d05979d Windows: Workaround for long paths (#23)
By using the short path version of a file, we can
manage to move long paths to the trash.

Limitations:
1/ If the final short path is longer than what
    `SHFileOperationW` can handle, it will fail
2/ Still not able to trash long path from another
    drive, ie: trying to delete C:\temp\foo.txt
    while the script is running from D:\trash.py
2018-02-16 09:07:05 -05:00
Virgil Dupras
f38aec6569 Reindent test_plat_other 2017-08-03 21:03:34 -04:00
Virgil Dupras
f324ff491e Properly reuse the "compat" unit 2017-08-03 20:47:58 -04:00
Virgil Dupras
f3231ef857 Merge branch 'unicode-trash' of https://github.com/takluyver/send2trash into takluyver-unicode-trash 2017-08-03 20:37:13 -04:00
Virgil Dupras
b7e3057853 Fix tests, add tox.ini and travis.yml 2017-08-03 20:34:10 -04:00