[test] add nodeinfo tests
All checks were successful
ci/woodpecker/push/lint Pipeline was successful
ci/woodpecker/push/test Pipeline was successful

This commit is contained in:
SouthFox 2023-07-09 18:06:21 +08:00
parent 1728fd4f6f
commit 0f04df1d9a

15
tests/test_nodeinfo.py Normal file
View file

@ -0,0 +1,15 @@
#!/usr/bin/env python3
"""Test App nodeinfo"""
def test_wellknow_nodeinfo(mocker, client):
"""Test app well-known nodeinfo ath."""
mocker.patch("demo.config.BASE_URL", "foo")
response = client.get("/.well-known/nodeinfo")
assert response.json["links"][0]["href"] == "foo/nodeinfo/2.0"
def test_nodeinfo(client):
"""Test app nodeinfo."""
response = client.get("/nodeinfo/2.0")
assert response.json["software"]["name"] == "COSCUP-demo"