writing some unit tests
This commit is contained in:
5
slopserver/test/test_api.py
Normal file
5
slopserver/test/test_api.py
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
from fastapi import FastAPI
|
||||||
|
from fastapi.testclient import TestClient
|
||||||
|
from slopserver.server import app as slopserver_app
|
||||||
|
|
||||||
|
client = TestClient(slopserver_app)
|
||||||
15
slopserver/test/test_db.py
Normal file
15
slopserver/test/test_db.py
Normal file
@@ -0,0 +1,15 @@
|
|||||||
|
from slopserver.db import *
|
||||||
|
from slopserver.models import *
|
||||||
|
from slopserver.settings import settings
|
||||||
|
from sqlalchemy import create_engine
|
||||||
|
import unittest
|
||||||
|
|
||||||
|
class TestDBFuncs(unittest.TestCase):
|
||||||
|
|
||||||
|
test_db_url = settings.db_url
|
||||||
|
engine = None
|
||||||
|
|
||||||
|
def setUp(self):
|
||||||
|
engine = create_engine(self.test_db_url)
|
||||||
|
|
||||||
|
|
||||||
Reference in New Issue
Block a user