当前位置: 首页>>代码示例>>Python>>正文


Python db.dropdb函数代码示例

本文整理汇总了Python中nailgun.db.dropdb函数的典型用法代码示例。如果您正苦于以下问题:Python dropdb函数的具体用法?Python dropdb怎么用?Python dropdb使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了dropdb函数的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: action_dropdb

def action_dropdb(params):
    from nailgun.db import dropdb
    from nailgun.logger import logger

    logger.info("Dropping database...")
    dropdb()
    logger.info("Done")
开发者ID:MsiRgb,项目名称:fuel-web,代码行数:7,代码来源:manage.py

示例2: setup_module

def setup_module():
    dropdb()
    alembic.command.upgrade(ALEMBIC_CONFIG, _prepare_revision)

    prepare()
    db.commit()

    alembic.command.downgrade(ALEMBIC_CONFIG, _test_revision)
开发者ID:sebrandon1,项目名称:fuel-web,代码行数:8,代码来源:test_downgrade_fuel_10_0.py

示例3: setup_module

def setup_module():
    dropdb()
    alembic.command.upgrade(ALEMBIC_CONFIG, _prepare_revision)
    prepare()
    global master_node_settings_before_migration
    master_node_settings_before_migration = jsonutils.loads(
        get_master_node_settings())
    alembic.command.upgrade(ALEMBIC_CONFIG, _test_revision)
开发者ID:ansumanbebarta,项目名称:fuel-web,代码行数:8,代码来源:test_migration_fuel_8_0.py

示例4: setup_module

def setup_module(module):
    dropdb()
    # Run core migration in order to create buffer table
    alembic.command.upgrade(ALEMBIC_CONFIG, _core_test_revision)
    prepare()
    # Run extension migrations
    ext_alembic_config = make_alembic_config_from_extension(
        VolumeManagerExtension)
    alembic.command.upgrade(ext_alembic_config, _extension_test_revision)
开发者ID:ekorekin,项目名称:fuel-web,代码行数:9,代码来源:test_migration_volume_manager_extension_001_add_volumes_table.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

        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:
            fixman.upload_fixture(fileobj)
        logger.info("Done")
    elif params.action == "loaddefault":
        logger.info("Uploading fixture...")
        from nailgun.fixtures import fixman
开发者ID:ilyinon,项目名称:fuelweb,代码行数:31,代码来源:manage.py

示例7: pytest_unconfigure

def pytest_unconfigure(config):
    from nailgun import db
    db.dropdb()
开发者ID:openstack,项目名称:fuel-nailgun-extension-cluster-upgrade,代码行数:3,代码来源:conftest.py

示例8: pytest_configure

def pytest_configure(config):
    from nailgun import db
    db.dropdb()
    db.syncdb()
开发者ID:openstack,项目名称:fuel-nailgun-extension-cluster-upgrade,代码行数:4,代码来源:conftest.py

示例9: test_clean_downgrade

 def test_clean_downgrade(self):
     dropdb()
     alembic.command.upgrade(ALEMBIC_CONFIG, 'head')
     alembic.command.downgrade(ALEMBIC_CONFIG, 'base')
开发者ID:dnikishov,项目名称:fuel-web,代码行数:4,代码来源:test_db_migrations.py

示例10: pytest_unconfigure

def pytest_unconfigure(config):
    cleandb = config.getoption('cleandb')
    if cleandb:
        from nailgun.db import dropdb
        dropdb()
开发者ID:SmartInfrastructures,项目名称:fuel-web-dev,代码行数:5,代码来源:conftest.py

示例11: setup_module

def setup_module(module):
    alembic_config = make_alembic_config_from_extension(VolumeManagerExtension)
    db.dropdb()
    alembic.command.upgrade(alembic_config, _test_revision)
开发者ID:SmartInfrastructures,项目名称:fuel-web-dev,代码行数:4,代码来源:test_db_migrations.py

示例12: setup_module

def setup_module(module):
    alembic_config = make_alembic_config_from_extension(
        extension.ClusterUpgradeExtension)
    db.dropdb()
    alembic.command.upgrade(alembic_config, _test_revision)
开发者ID:SmartInfrastructures,项目名称:fuel-web-dev,代码行数:5,代码来源:test_db_migrations.py


注:本文中的nailgun.db.dropdb函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。