mirror of
https://framagit.org/framasoft/framaspace/argos.git
synced 2025-04-28 18:02:41 +02:00
- Start implementing some tests using pytest - Packaged using pyproject.toml - Implemented SSL checks using httpx - Checks can now run partially on the server, to access the configuration and determine the severity of the error if any - Used black to format all the files - Added an utility to convert strings like "3d" and "3w" to days - The internal representation of SSL thresholds is now a list of tuples - Models were lacking some relationship between Tasks and Results
20 lines
597 B
Python
20 lines
597 B
Python
import pytest
|
|
from argos.checks.base import Response, Status
|
|
|
|
|
|
def test_response_failure_with_context():
|
|
resp = Response.new(False, some="context", another=True)
|
|
assert resp.status == Status.FAILURE
|
|
assert resp.context == {"some": "context", "another": True}
|
|
|
|
|
|
def test_response_success():
|
|
resp = Response.new(True)
|
|
assert resp.status == Status.SUCCESS
|
|
|
|
|
|
def test_response_on_check_with_context():
|
|
resp = Response.new(Status.ON_CHECK, expires_in=3)
|
|
assert resp.status == Status.ON_CHECK
|
|
assert resp.status == "on-check"
|
|
assert resp.context == {"expires_in": 3}
|