diff options
author | chenjiankun <chenjiankun1@huawei.com> | 2017-01-17 15:40:17 +0000 |
---|---|---|
committer | chenjiankun <chenjiankun1@huawei.com> | 2017-01-17 15:40:17 +0000 |
commit | 483e2fcf41adcdddad5543c04d3ad42c60def334 (patch) | |
tree | 38e4b419debb87db17b9986a726535145b329759 /api/server.py | |
parent | 4b706011d16f3dfd4fe0a78c5d8706d69deecdeb (diff) |
Add unittest framework for Yardstick API
JIRA: YARDSTICK-538
Currently it is hard to test API, So I add a base class as flask
document do.
In this framework I will mock a temp sqlite database and a server.
Change-Id: If881233cb22655617c07ad018201b8ee08492d06
Signed-off-by: chenjiankun <chenjiankun1@huawei.com>
Diffstat (limited to 'api/server.py')
-rw-r--r-- | api/server.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/api/server.py b/api/server.py index 5bac1ba47..be7963481 100644 --- a/api/server.py +++ b/api/server.py @@ -52,7 +52,6 @@ def init_db(): Base.metadata.create_all(bind=engine) -init_db() reduce(lambda a, b: a.add_resource(b.resource, b.url, endpoint=b.endpoint) or a, urlpatterns, api) @@ -60,4 +59,5 @@ if __name__ == '__main__': _init_logging() logger.setLevel(logging.DEBUG) logger.info('Starting server') + init_db() app.run(host='0.0.0.0') |