Buckets:

download
raw
1.13 kB
"""Tests for api/envelope.py — response envelope helpers."""
from airflow_watcher.api.envelope import error_response, success_response
class TestSuccessResponse:
def test_has_required_keys(self):
result = success_response({"foo": 1})
assert result["status"] == "success"
assert result["data"] == {"foo": 1}
assert "timestamp" in result
def test_timestamp_ends_with_z(self):
result = success_response(None)
assert result["timestamp"].endswith("Z")
def test_accepts_none(self):
result = success_response(None)
assert result["data"] is None
def test_accepts_list(self):
result = success_response([1, 2, 3])
assert result["data"] == [1, 2, 3]
class TestErrorResponse:
def test_has_required_keys(self):
result = error_response("something went wrong")
assert result["status"] == "error"
assert result["error"] == "something went wrong"
assert "timestamp" in result
def test_timestamp_ends_with_z(self):
result = error_response("err")
assert result["timestamp"].endswith("Z")

Xet Storage Details

Size:
1.13 kB
·
Xet hash:
5e562c140a4c9dd651e6e27fc688b54401ae7cab419a63693823130e306310ba

Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.