13 Commits (4e3d81ccae6d7b827cbbadf615b50674633dc3ba)

Author SHA1 Message Date
Maxim Zhiltsov c808471d84
Improve SDK UX with task creation (#5502)
Extracted from https://github.com/opencv/cvat/pull/5083

- Added a default arg for task data uploading
- Added an option to wait for the data processing in task data uploading
- Moved data splitting by requests for TUS closer to the point of use
3 years ago
Andrey Zhavoronkov 52e3f3c28a
Added tests for preview endpoints (#5529) 3 years ago
Maxim Zhiltsov af65707eee
Mark tests that require external services (#5474)
Related: #5225 

External services are not available when we execute in Helm.

- Added a way to mark REST API tests that require external services to
run
- Changed the way of filtering tests in Helm tests

Currently, we can't execute external service mocks in tests, and we
ignore related tests in the Helm
execution command. But this command may be outdated, because Helm tests
are not executed in each PR.
This PR allows to indicate related tests and filter them out without the
need to synchronize the CI command.
3 years ago
Roman Donchenko 0a032b3236
Migrate to using pathlib in most of the SDK (#5435)
For user-facing functions, keep accepting `str` paths to maintain
compatibility and flexibility, but add support for arbitrary path-like
objects. For internal functions (in `downloading.py` and
`uploading.py`), don't bother and require `pathlib.Path`.

The only code that isn't converted is build-time code (e.g. `setup.py`)
and code that came from openapi-generator.
3 years ago
Roman Donchenko 481630e719
Migrate tests/python to from os.path to pathlib (#5426)
`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.
3 years ago
Roman Donchenko 192fd72680
Fix creation of tasks with Git repositories via the SDK (#5409)
Fixes #4365
3 years ago
Roman Donchenko 0a16cfce5b
SDK: add a high-level method to download task data chunks (#5356) 3 years ago
Roman Donchenko aadfd8814e
Fix TUS offset queries in production environments (#5204)
* 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
3 years ago
Kirill Sizov ce09f28512
Fix SDK tests: login once per class (#5123) 3 years ago
Aleksey Alekseev c3dd3499e3
Added Cypress testing for feature: Multiple tasks creating from videos (#5028)
* 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>
3 years ago
Роман Донченко b029bc9da8
cvat-sdk: Fix creating tasks with non-local files (#5058)
* 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.
3 years ago
Maxim Zhiltsov 53697ecac5
SDK layer 2 - cover RC1 usecases (#4813) 4 years ago
Maxim Zhiltsov 5f58a0f7be
Add 2nd layer of SDK (#19) 4 years ago