Add tests and more docs
This commit is contained in:
parent
7fa907699d
commit
ea3d617e9c
@ -16,8 +16,16 @@
|
||||
## Run dev server
|
||||
|
||||
source venv/bin/activate
|
||||
python -m kdoorweb
|
||||
|
||||
Or
|
||||
|
||||
bottle.py --debug --reload kdoorweb:application
|
||||
|
||||
To set the TCP port number add it as the last argument
|
||||
|
||||
python -m kdoorweb 8888
|
||||
|
||||
## Run unittests
|
||||
|
||||
source venv/bin/activate
|
||||
|
@ -238,7 +238,7 @@ def initdb():
|
||||
pass
|
||||
DB.create_db(dbfile)
|
||||
db = DB(dbfile)
|
||||
db.add_users(db.import_ad("../ad.json"))
|
||||
db.add_users(db.import_ad("ad.json"))
|
||||
users = db.list_users()
|
||||
for user in users:
|
||||
print(dict(user))
|
||||
|
12
kdoorweb/tests/test_db.py
Normal file
12
kdoorweb/tests/test_db.py
Normal file
@ -0,0 +1,12 @@
|
||||
import unittest
|
||||
|
||||
from kdoorweb.db import DB
|
||||
|
||||
|
||||
class TestDB(unittest.TestCase):
|
||||
def test_create_db_in_memory(self):
|
||||
DB.create_db(dbfile=":memory:")
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
unittest.main()
|
Loading…
Reference in New Issue
Block a user