Skip to content

Commit 0140a2a

Browse files
authored
chore: UTC-53: Rewrite test_docs.tavern.yml into pytest (#7616)
Co-authored-by: mcanu <mcanu@users.noreply.github.com>
1 parent a11bce7 commit 0140a2a

File tree

2 files changed

+44
-28
lines changed

2 files changed

+44
-28
lines changed

label_studio/tests/test_docs.py

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
# ---
2+
3+
# test_name: test_docs
4+
5+
# strict: False
6+
7+
# marks:
8+
# - usefixtures:
9+
# - django_live_url
10+
11+
# stages:
12+
# - name: signup
13+
# request:
14+
# url: "{django_live_url}/user/signup"
15+
# data:
16+
# email: test_suites_user@heartex.com
17+
# password: 12345678
18+
# method: POST
19+
# response:
20+
# status_code: 302
21+
# - name: get_docs
22+
# request:
23+
# url: "{django_live_url}/docs/api?format=openapi"
24+
# method: GET
25+
# response:
26+
# status_code: 200
27+
# verify_response_with:
28+
# function: tests.utils:verify_docs
29+
import pytest
30+
from organizations.tests.factories import OrganizationFactory
31+
from rest_framework.test import APIClient
32+
from tests.utils import verify_docs
33+
34+
35+
@pytest.mark.django_db
36+
def test_docs():
37+
organization = OrganizationFactory()
38+
user = organization.created_by
39+
client = APIClient()
40+
client.force_authenticate(user)
41+
42+
response = client.get('/docs/api?format=openapi')
43+
assert response.status_code == 200
44+
verify_docs(response)

label_studio/tests/test_docs.tavern.yml

Lines changed: 0 additions & 28 deletions
This file was deleted.

0 commit comments

Comments
 (0)