2020-07-10 12:58:53 +02:00
|
|
|
#!/usr/bin/env python3
|
|
|
|
import pytest
|
|
|
|
from starlette.authentication import UnauthenticatedUser
|
|
|
|
from starlette.testclient import TestClient
|
2020-09-25 01:06:21 +02:00
|
|
|
from halfapi.app import application
|
|
|
|
import json
|
2020-07-10 12:58:53 +02:00
|
|
|
|
|
|
|
def test_itworks():
|
2020-09-25 01:06:21 +02:00
|
|
|
c = TestClient(application)
|
|
|
|
r = json.loads(c.get('/').text)
|
|
|
|
assert r == 'It Works!'
|
2020-07-10 12:58:53 +02:00
|
|
|
|
|
|
|
def test_user():
|
2020-09-25 01:06:21 +02:00
|
|
|
c = TestClient(application)
|
2020-07-10 12:58:53 +02:00
|
|
|
r = c.get('/user')
|
|
|
|
assert r.status_code == 200
|
2020-09-25 01:06:21 +02:00
|
|
|
|
|
|
|
def test_user():
|
|
|
|
c = TestClient(application)
|
|
|
|
r = c.get('/schema')
|
|
|
|
assert r.status_code == 200
|