From dbcfb30cb2797f9e866614f65249c3d3806c5b14 Mon Sep 17 00:00:00 2001 From: Kirill Sizov Date: Tue, 11 Oct 2022 14:35:59 +0300 Subject: [PATCH] Fix SDK tests (#5077) * Update SDK tests to use LoginSerializerEx --- .github/workflows/full.yml | 1 + .github/workflows/main.yml | 1 + cvat-sdk/cvat_sdk/core/client.py | 2 +- tests/python/rest_api/test_auth.py | 2 +- 4 files changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/full.yml b/.github/workflows/full.yml index 321b08c19..f76b4207a 100644 --- a/.github/workflows/full.yml +++ b/.github/workflows/full.yml @@ -90,6 +90,7 @@ jobs: - name: CVAT SDK. Build run: | + docker load --input /tmp/cvat_server/image.tar docker run --rm -v ${PWD}/cvat-sdk/schema/:/transfer \ --entrypoint /bin/bash -u root cvat/server \ -c 'python manage.py spectacular --file /transfer/schema.yml' diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index c50af7a6e..bc425ffe6 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -91,6 +91,7 @@ jobs: - name: CVAT SDK. Build run: | + docker load --input /tmp/cvat_server/image.tar docker run --rm -v ${PWD}/cvat-sdk/schema/:/transfer \ --entrypoint /bin/bash -u root cvat/server \ -c 'python manage.py spectacular --file /transfer/schema.yml' diff --git a/cvat-sdk/cvat_sdk/core/client.py b/cvat-sdk/cvat_sdk/core/client.py index 4f772d7b9..ba34572a0 100644 --- a/cvat-sdk/cvat_sdk/core/client.py +++ b/cvat-sdk/cvat_sdk/core/client.py @@ -143,7 +143,7 @@ class Client: def login(self, credentials: Tuple[str, str]) -> None: (auth, _) = self.api_client.auth_api.create_login( - models.LoginRequest(username=credentials[0], password=credentials[1]) + models.LoginSerializerExRequest(username=credentials[0], password=credentials[1]) ) assert "sessionid" in self.api_client.cookies diff --git a/tests/python/rest_api/test_auth.py b/tests/python/rest_api/test_auth.py index c9c632a0c..7bf104f19 100644 --- a/tests/python/rest_api/test_auth.py +++ b/tests/python/rest_api/test_auth.py @@ -27,7 +27,7 @@ class TestTokenAuth: @staticmethod def login(client: ApiClient, username: str) -> models.Token: (auth, _) = client.auth_api.create_login( - models.LoginRequest(username=username, password=USER_PASS) + models.LoginSerializerExRequest(username=username, password=USER_PASS) ) client.set_default_header("Authorization", "Token " + auth.key) return auth -- GitLab