Create integration/test_integration.py
Browse files
tests/integration/test_integration.py
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import os
|
| 2 |
+
import pytest
|
| 3 |
+
import requests
|
| 4 |
+
from dotenv import load_dotenv
|
| 5 |
+
|
| 6 |
+
load_dotenv()
|
| 7 |
+
|
| 8 |
+
API_URL = os.environ.get("API_URL")
|
| 9 |
+
AUTH_TOKEN = os.environ.get("AUTH_TOKEN")
|
| 10 |
+
headers = {"Authorization": f"Bearer {AUTH_TOKEN}"}
|
| 11 |
+
|
| 12 |
+
|
| 13 |
+
def test_api():
|
| 14 |
+
responce = requests.post(API_URL, headers=headers, json='{"существительное"}')
|
| 15 |
+
assert responce.status_code > 0
|