本文整理汇总了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")
示例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()
示例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()
示例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))
示例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()
示例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:
示例7: setUpClass
def setUpClass(cls):
cls.db = db()
cls.app = TestApp(build_app().wsgifunc())
syncdb()
示例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()
示例9: setUpClass
def setUpClass(cls):
super(BaseAuthenticationIntegrationTest, cls).setUpClass()
cls.app = app.TestApp(
build_app(db_driver=test_db_driver).wsgifunc(ConnectionMonitorMiddleware, NailgunFakeKeystoneAuthMiddleware)
)
syncdb()
示例10: pytest_configure
def pytest_configure(config):
from nailgun import db
db.dropdb()
db.syncdb()
示例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()