`pathlib` improves code readability and type safety. It is already used
in some of the tests; convert all remaining `os.path` usage to `pathlib`
equivalents.
* Fix TUS offset queries in production environments
Previously, `mod_wsgi` would convert `HEAD` requests into `GET`, which
would be rejected, so clients were unable to resume an upload that failed
midway through.
To make use of this, update the SDK code to enable upload resumption.
* Add a test that forces a chunked TUS upload
* test_can_create_from_backup_in_chunks: make sure the upload is actually chunked
* add tests for try of creating multitasks with images and video
* add tests seccess creating video with Remote source
* reduce time of debounce
* try fix 107, 118 tests
* try fix 107 tests
* fix test with attach video
* disable test with attach video
* fix url to remote videos
* Aborted extra changes
* Updated files
* Refactored case 107
* Fixed almost all tests
* Aborted extra changes
* removed extra files
* Improved tests, added tests for local videos
* Fixed corner case
* Fix ://
* Redesigned a way of getting a file type
* Added html type to button
* Some refactoring
* Removed extra file
* sdk tests: fix path for file share images
Co-authored-by: Boris <sekachev.bs@gmail.com>
Co-authored-by: kirill-sizov <sizow.k.d@gmail.com>
* Move the test file share contents to tests/share
This way, it can be reused between tests.
* cvat-sdk: Fix creating tasks with non-local files
Forcing the `Content-Type` for the `upload_data` API call to
`multipart/form-data` does not work, because the current logic for
converting Python values to parts (`ApiClient._convert_body_to_post_params`)
does not encode them in a way that Django REST Framework can understand (it
JSON-encodes each part).
Fortunately, we don't actually need to do that, since when we create a task
with non-local files, we don't need to upload any files, and so we can just
post the original JSON, so do just that.
I couldn't add a test for the remote image case, because CVAT rejects all URLs
with non-public IP addressses. However, I did test this case manually.