本文整理汇总了Python中nailgun.db.syncdb函数的典型用法代码示例。如果您正苦于以下问题:Python syncdb函数的具体用法?Python syncdb怎么用?Python syncdb使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了syncdb函数的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Python代码示例。
示例1: action_syncdb
def action_syncdb(params):
from nailgun.db import syncdb
from nailgun.logger import logger
logger.info("Syncing database...")
syncdb()
logger.info("Done")
开发者ID:sirmax123,项目名称:fuel-web,代码行数:7,代码来源:manage.py
示例2: setUpClass
def setUpClass(cls):
if not settings.PERFORMANCE_PROFILING_TESTS:
raise SkipTest("PERFORMANCE_PROFILING_TESTS in settings.yaml" "is not set")
if os.path.exists(settings.LOAD_TESTS_PATHS["load_tests_base"]):
shutil.rmtree(settings.LOAD_TESTS_PATHS["load_tests_base"])
os.makedirs(settings.LOAD_TESTS_PATHS["load_tests_base"])
cls.app = app.TestApp(build_app(db_driver=test_db_driver).wsgifunc(ProfilerMiddleware))
syncdb()
开发者ID:yxh1990,项目名称:fuel-cloudmaster,代码行数:8,代码来源:base.py
示例3: setUpClass
def setUpClass(cls):
cls.db = scoped_session(
sessionmaker(bind=engine, query_cls=NoCacheQuery)
)
cls.app = TestApp(build_app().wsgifunc())
nailgun.task.task.DeploymentTask._prepare_syslog_dir = mock.Mock()
# dropdb()
syncdb()
开发者ID:akolinko,项目名称:product,代码行数:8,代码来源:base.py
示例4: setUpClass
def setUpClass(cls):
if os.path.exists(settings.LOAD_TESTS_PATHS['load_tests_base']):
shutil.rmtree(settings.LOAD_TESTS_PATHS['load_tests_base'])
os.makedirs(settings.LOAD_TESTS_PATHS['load_tests_base'])
cls.app = app.TestApp(build_app(db_driver=test_db_driver).
wsgifunc(ProfilerMiddleware))
syncdb()
cls.tests_results = defaultdict(
lambda: defaultdict(lambda: defaultdict(list)))
cls.tests_stats = defaultdict(lambda: defaultdict(dict))
开发者ID:TorstenS73,项目名称:fuel-web,代码行数:10,代码来源:base.py
示例5: pytest_configure
def pytest_configure(config):
db_name = config.getoption('dbname')
if hasattr(config, 'slaveinput'):
#slaveid have next format gw1
#it is internal pytest thing, and we dont want to use it
uid = re.search(r'\d+', config.slaveinput['slaveid']).group(0)
db_name = '{0}{1}'.format(db_name, uid)
connection = connect(
dbname='postgres', user=settings.DATABASE['user'],
host=settings.DATABASE['host'],
password=settings.DATABASE['passwd'])
cursor = connection.cursor()
if not_present(cursor, db_name):
create_database(connection, cursor, db_name)
settings.DATABASE['name'] = db_name
cleandb = config.getoption('cleandb')
if cleandb:
from nailgun.db import dropdb, syncdb
dropdb()
syncdb()
开发者ID:SmartInfrastructures,项目名称:fuel-web-dev,代码行数:20,代码来源:conftest.py
示例6: syncdb
sys.argv.pop(1)
if params.action == "dumpdata":
import logging
logging.disable(logging.WARNING)
from nailgun.fixtures import fixman
fixman.dump_fixture(params.model)
sys.exit(0)
from nailgun.logger import logger
from nailgun.settings import settings
if params.action == "syncdb":
logger.info("Syncing database...")
from nailgun.db import syncdb
syncdb()
logger.info("Done")
elif params.action == "dropdb":
logger.info("Dropping database...")
from nailgun.db import dropdb
dropdb()
logger.info("Done")
elif params.action == "test":
logger.info("Running tests...")
from nailgun.unit_test import TestRunner
TestRunner.run()
logger.info("Done")
elif params.action == "loaddata":
logger.info("Uploading fixture...")
from nailgun.fixtures import fixman
with open(params.fixture, "r") as fileobj:
开发者ID:ilyinon,项目名称:fuelweb,代码行数:31,代码来源:manage.py
示例7: setUpClass
def setUpClass(cls):
cls.db = db()
cls.app = TestApp(build_app().wsgifunc())
syncdb()
开发者ID:adanin,项目名称:fuel-web,代码行数:4,代码来源:base.py
示例8: setUpClass
def setUpClass(cls):
cls.db = db()
cls.app = TestApp(build_app().wsgifunc())
nailgun.task.task.DeploymentTask._prepare_syslog_dir = mock.Mock()
# dropdb()
syncdb()
开发者ID:ilyinon,项目名称:fuelweb,代码行数:6,代码来源:base.py
示例9: setUpClass
def setUpClass(cls):
super(BaseAuthenticationIntegrationTest, cls).setUpClass()
cls.app = app.TestApp(
build_app(db_driver=test_db_driver).wsgifunc(ConnectionMonitorMiddleware, NailgunFakeKeystoneAuthMiddleware)
)
syncdb()
开发者ID:thefuyang,项目名称:fuel-web,代码行数:6,代码来源:base.py
示例10: pytest_configure
def pytest_configure(config):
from nailgun import db
db.dropdb()
db.syncdb()
开发者ID:openstack,项目名称:fuel-nailgun-extension-cluster-upgrade,代码行数:4,代码来源:conftest.py
示例11: setUpClass
def setUpClass(cls):
cls.app = app.TestApp(build_app(db_driver=test_db_driver).wsgifunc(
NailgunFakeKeystoneAuthMiddleware))
syncdb()
nailgun.task.task.DeploymentTask._prepare_syslog_dir = mock.Mock()
开发者ID:slystopad,项目名称:fuel-web,代码行数:5,代码来源:base.py
注:本文中的nailgun.db.syncdb函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论