aboutsummaryrefslogtreecommitdiffstats
path: root/python/tests/tools_api.py
blob: 0de43f9b04577fa987da8c94800d8bcec5b3329a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
import pytest
from fatcat_openapi_client.rest import ApiException

from fatcat_tools import authenticated_api, public_api


def test_authenticated_api():
    api = authenticated_api("http://localhost:9411/v0")
    api.get_changelog()
    api.auth_check()


def test_public_api():
    api = public_api("http://localhost:9411/v0")
    api.get_changelog()
    with pytest.raises(ApiException):
        api.auth_check()