Пример #1
0
def teardown_module():
    fresh_metadata = get_metadata('fresh')
    fresh_metadata.drop_all()
    fresh_metadata.bind.dispose()
    metadata.drop_all()
    sqlalchemy_cleanup()
    if os.path.exists('freshtest.db'):
        os.unlink('freshtest.db')

    stop_server()
Пример #2
0
def teardown_module():
    drop_tables()
    sqlalchemy_cleanup()
Пример #3
0
from gearshift.database import get_engine, metadata, session, mapper
from gearshift.paginate import paginate, sort_ordering, sort_data
from gearshift.testutil import sqlalchemy_cleanup
from turbojson.jsonify import jsonify

import cherrypy
from sqlalchemy import Table, Column, ForeignKey, Integer, String
from sqlalchemy.orm import relation
from sqlobject import SQLObject, IntCol, StringCol, connectionForURI

query_methods = 'Q QA SO SL'.split()

config.update({"sqlalchemy.dburi": "sqlite:///:memory:"})

# sqlalchemy setup
sqlalchemy_cleanup()
get_engine()

# sqlobject setup
database.set_db_uri("sqlite:///:memory:")
__connection__ = hub = database.PackageHub('test_paginate')


class listlike(object):
    """A minimum list-like object that is needed for paginate."""
    def __init__(self, *args):
        self._list = list(*args)

    def __len__(self):
        return len(self._list)
Пример #4
0
def teardown_module():
    drop_tables()
    sqlalchemy_cleanup()
Пример #5
0
from gearshift.database import get_engine, metadata, session, mapper
from gearshift.paginate import paginate, sort_ordering, sort_data
from gearshift.testutil import sqlalchemy_cleanup
from turbojson.jsonify import jsonify

import cherrypy
from sqlalchemy import Table, Column, ForeignKey, Integer, String
from sqlalchemy.orm import relation
from sqlobject import SQLObject, IntCol, StringCol, connectionForURI

query_methods = 'Q QA SO SL'.split()

config.update({"sqlalchemy.dburi": "sqlite:///:memory:"})

# sqlalchemy setup
sqlalchemy_cleanup()
get_engine()

# sqlobject setup
database.set_db_uri("sqlite:///:memory:")
__connection__ = hub = database.PackageHub('test_paginate')


class listlike(object):
    """A minimum list-like object that is needed for paginate."""

    def __init__(self, *args):
        self._list = list(*args)

    def __len__(self):
        return len(self._list)