Пример #1
0
 def setUp(self):
     self.app = create_app('tests.config')
     self.db_name = self.app.config['ARANGO_DB']
     with self.app.app_context():
         self.db_inst = DB()
         self._cleanup()
         self.db_inst.get_database()
Пример #2
0
 def setUp(self):
     self.app = create_app('tests.config')
     self.db_name = self.app.config['ARANGO_DB']
     with self.app.app_context():
         self.db_inst = DB()
         self._cleanup()
         self.db_inst.get_database()
    def setUp(self):
        patch('globomap_api.api_plugins.zabbix.config').start()
        self.app = create_app('tests.config')
        self.client = self.app.test_client()

        self.hosts = {'result': [{'hostid': 1}]}
        self.triggers = {'result': [
            {'triggerid': 1, 'description': 'CPU 99%', 'value': 1}]}
Пример #4
0
    def setUp(self):
        self.app = create_app('tests.config')
        self.db_inst = DB(self.app.config)

        self.conn_db()
        self.cleanup()
        self.db_inst.database.create_database('test')

        self.db_inst.conn_database('test')
Пример #5
0
def cleanup():
    app = create_app('tests.config')
    db_inst = DB(app.config)
    db_name = app.config['ARANGO_DB']
    db_inst.conn_database(db_name)
    for col in db_inst.database.collections():
        if 'meta' not in col['name'] and col['system'] is False:
            db_inst.database.delete_collection(col['name'])
    db_inst.database.collection('meta_collection').truncate()
Пример #6
0
"""
   Copyright 2017 Globo.com

   Licensed under the Apache License, Version 2.0 (the "License");
   you may not use this file except in compliance with the License.
   You may obtain a copy of the License at

       http://www.apache.org/licenses/LICENSE-2.0

   Unless required by applicable law or agreed to in writing, software
   distributed under the License is distributed on an "AS IS" BASIS,
   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   See the License for the specific language governing permissions and
   limitations under the License.
"""
from globomap_api.app import create_app
application = create_app()
Пример #7
0
 def setUp(self):
     self.app = create_app('tests.config')
     self.client = self.app.test_client()
Пример #8
0
 def setUp(self):
     self.app = create_app('tests.config')
     with self.app.app_context():
         self.db_inst = DB()
         self._cleanup()
         self.db_inst.get_database()
Пример #9
0
 def setUp(self):
     self.app = create_app('tests.config')
     with self.app.app_context():
         self.db_inst = DB()
         self._cleanup()
         self.db_inst.get_database()