mirror of
https://github.com/veops/cmdb.git
synced 2025-08-07 13:48:06 +08:00
升级后端并开源UI
This commit is contained in:
1
tests/__init__.py
Normal file
1
tests/__init__.py
Normal file
@@ -0,0 +1 @@
|
||||
"""Tests for the app."""
|
24
tests/conftest.py
Normal file
24
tests/conftest.py
Normal file
@@ -0,0 +1,24 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
"""Defines fixtures available to all tests."""
|
||||
|
||||
import pytest
|
||||
from webtest import TestApp
|
||||
|
||||
from api.app import create_app
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
def app():
|
||||
"""Create application for the tests."""
|
||||
_app = create_app("tests.settings")
|
||||
ctx = _app.test_request_context()
|
||||
ctx.push()
|
||||
yield _app
|
||||
|
||||
ctx.pop()
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
def testapp(app):
|
||||
"""Create Webtest app."""
|
||||
return TestApp(app)
|
1
tests/test_cmdb_attribute.py
Normal file
1
tests/test_cmdb_attribute.py
Normal file
@@ -0,0 +1 @@
|
||||
# -*- coding: utf-8 -*-
|
10
tests/test_cmdb_ci.py
Normal file
10
tests/test_cmdb_ci.py
Normal file
@@ -0,0 +1,10 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
|
||||
class TestCI:
|
||||
|
||||
def test_ci_search_only_type_query(self, app):
|
||||
with app.test_client() as c:
|
||||
rv = c.get('/api/v0.1/ci/s?q=_type:server', json={})
|
||||
json_data = rv.get_json()
|
||||
assert type(json_data.get("result")) is list
|
1
tests/test_cmdb_ci_realtion.py
Normal file
1
tests/test_cmdb_ci_realtion.py
Normal file
@@ -0,0 +1 @@
|
||||
# -*- coding: utf-8 -*-
|
1
tests/test_cmdb_ci_type.py
Normal file
1
tests/test_cmdb_ci_type.py
Normal file
@@ -0,0 +1 @@
|
||||
# -*- coding: utf-8 -*-
|
1
tests/test_cmdb_ci_type_relation.py
Normal file
1
tests/test_cmdb_ci_type_relation.py
Normal file
@@ -0,0 +1 @@
|
||||
# -*- coding: utf-8 -*-
|
1
tests/test_cmdb_history.py
Normal file
1
tests/test_cmdb_history.py
Normal file
@@ -0,0 +1 @@
|
||||
# -*- coding: utf-8 -*-
|
1
tests/test_cmdb_preference.py
Normal file
1
tests/test_cmdb_preference.py
Normal file
@@ -0,0 +1 @@
|
||||
# -*- coding: utf-8 -*-
|
1
tests/test_cmdb_relation_type.py
Normal file
1
tests/test_cmdb_relation_type.py
Normal file
@@ -0,0 +1 @@
|
||||
# -*- coding: utf-8 -*-
|
Reference in New Issue
Block a user