Add initial Python test setup and health check test

This commit is contained in:
omri zaher 2025-08-03 18:31:27 +03:00
parent e690b54bc6
commit c053ec3b56
8 changed files with 44 additions and 0 deletions

0
.env.example Normal file
View file

18
.gitignore vendored
View file

@ -39,3 +39,21 @@ ehthumbs.db
# Chart dependencies
/helm/wekan/**/*.tgz
/helm/wekan/charts
# Python virtual environment
venv/
.venv/
__pycache__/
*.pyc
*.pyo
*.pyd
.Python
env/
pip-log.txt
pip-delete-this-directory.txt
.tox/
.pytest_cache/
*.egg-info/
.coverage
htmlcov/

View file

@ -12,6 +12,10 @@
"url": "https://github.com/wekan/wekan/issues"
},
"homepage": "https://wekan.github.io",
"scripts": {
"test:python": "python -m pytest tests/ -v -s",
"test:auth": "python -m pytest tests/auth/test_login.py -v"
},
"devDependencies": {
"flatted": "^3.3.1",
"sinon": "^13.0.2"

2
pytest.ini Normal file
View file

@ -0,0 +1,2 @@
[pytest]
testpaths = tests

2
requirements.txt Normal file
View file

@ -0,0 +1,2 @@
pytest==7.4.3
requests==2.31.0

0
tests/__init__.py Normal file
View file

0
tests/auth/__init__.py Normal file
View file

18
tests/auth/test_login.py Normal file
View file

@ -0,0 +1,18 @@
import pytest
import requests
import os
BASE_URL = os.getenv('WEKAN_URL', 'http://localhost:3000')
TEST_USERNAME = 'testuser'
TEST_PASSWORD = 'testpass123'
TEST_EMAIL = 'test@example.com'
base_url="http://10.0.0.17/"
class TestLogin:
def test_health_check(self):
"""Test basic health check"""
response = requests.get(f"{base_url}")
# assert response.status_code == 400
print("**************",response.status_code)
assert response.status_code == 200