def test_db_init(global_integration_cli_args, db, local_config): drop_db(db._connection) assert not has_schema(db._engine, db._connection) # Run on an empty database. opts = list(global_integration_cli_args) opts.extend(['-v', 'system', 'init']) cli_method = datacube.scripts.cli_app.cli result = _run_cli(cli_method, opts) assert result.exit_code == 0 assert 'Created.' in result.output assert has_schema(db._engine, db._connection)
def test_db_init(global_integration_cli_args, db, local_config): with db.connect() as connection: drop_db(connection._connection) assert not has_schema(db._engine, connection._connection) # Run on an empty database. cli_method = datacube.scripts.cli_app.cli result = _run_cli(global_integration_cli_args, cli_method, ['-v', 'system', 'init']) assert result.exit_code == 0 assert 'Created.' in result.output with db.connect() as connection: assert has_schema(db._engine, connection._connection)
def test_db_init(global_integration_cli_args, db, local_config): drop_db(db._connection) assert not has_schema(db._engine, db._connection) # Run on an empty database. opts = list(global_integration_cli_args) opts.extend( [ '-v', 'system', 'init' ] ) cli_method = datacube.scripts.cli_app.cli result = _run_cli(cli_method, opts) assert result.exit_code == 0 assert 'Done.' in result.output assert has_schema(db._engine, db._connection)