Пример #1
0
    def setUp(self):
        engine = create_engine("sqlite:///:memory:")

        event.listen(engine, "connect", _fk_pragma_on_connect)
        db_session.configure(bind=engine)

        Base.metadata.create_all(bind=engine)

        self.init_db()
        self.db_session = db_session
        self.app = app.test_client()
Пример #2
0
    def setUp(self):
        engine = create_engine('sqlite:///:memory:')

        event.listen(engine, 'connect', _fk_pragma_on_connect)
        db_session.configure(bind=engine)

        Base.metadata.create_all(bind=engine)

        self.init_db()
        self.db_session = db_session
        self.app = app.test_client()
Пример #3
0
    def setUp(self):
        engine = create_engine('sqlite:///:memory:')
        # engine = create_engine('sqlite:///test.db')

        event.listen(engine, 'connect', _fk_pragma_on_connect)
        db_session.configure(bind=engine)

        Base.metadata.create_all(bind=engine)

        db_session.add_all([Arch('i586'), Arch('x86_64'), Arch('noarch')])
        db_session.add_all([Distro('Fedora', '16'),
                           Distro('openSUSE', '12.1')])
        db_session.add_all([PackageStatus('voted'), PackageStatus('recent'),
                            PackageStatus('no-files'), PackageStatus('old')])
        db_session.add(Vendor('http://repo.url'))
        db_session.flush()

        self.db_session = db_session
Пример #4
0
    def setUp(self):
        engine = create_engine("sqlite:///:memory:")
        # engine = create_engine('sqlite:///test.db')

        event.listen(engine, "connect", _fk_pragma_on_connect)
        db_session.configure(bind=engine)

        Base.metadata.create_all(bind=engine)

        db_session.add_all([Arch("i586"), Arch("x86_64"), Arch("noarch")])
        db_session.add_all([Distro("Fedora", "16"), Distro("openSUSE", "12.1")])
        db_session.add_all(
            [PackageStatus("voted"), PackageStatus("recent"), PackageStatus("no-files"), PackageStatus("old")]
        )
        db_session.add(Vendor("http://repo.url"))
        db_session.flush()

        # system is dependent on both arches and distros already being in the db
        db_session.add_all([System("hw_uuid1", "i586", "Fedora", "16"), System("hw_uuid2", "i586", "openSUSE", "12.1")])
        db_session.commit()

        self.db_session = db_session
Пример #5
0
    def setUp(self):
        engine = create_engine('sqlite:///:memory:')
        # engine = create_engine('sqlite:///test.db')

        event.listen(engine, 'connect', _fk_pragma_on_connect)
        db_session.configure(bind=engine)

        Base.metadata.create_all(bind=engine)

        db_session.add_all([Arch('i586'), Arch('x86_64'), Arch('noarch')])
        db_session.add_all(
            [Distro('Fedora', '16'),
             Distro('openSUSE', '12.1')])
        db_session.add_all([
            PackageStatus('voted'),
            PackageStatus('recent'),
            PackageStatus('no-files'),
            PackageStatus('old')
        ])
        db_session.add(Vendor('http://repo.url'))
        db_session.flush()

        self.db_session = db_session
Пример #6
0
    def setUp(self):
        engine = create_engine('sqlite:///:memory:')
        # engine = create_engine('sqlite:///test.db')

        event.listen(engine, 'connect', _fk_pragma_on_connect)
        db_session.configure(bind=engine)

        Base.metadata.create_all(bind=engine)

        db_session.add_all([Arch('i586'), Arch('x86_64'), Arch('noarch')])
        db_session.add_all([Distro('Fedora', '16'),
                           Distro('openSUSE', '12.1')])
        db_session.add_all([PackageStatus('voted'), PackageStatus('recent'),
                            PackageStatus('no-files'), PackageStatus('old')])
        db_session.add(Vendor('http://repo.url'))
        db_session.flush()

        # system is dependent on both arches and distros already being
        # in the db
        db_session.add_all([System('hw_uuid1', 'i586', 'Fedora', '16'),
                            System('hw_uuid2', 'i586', 'openSUSE', '12.1')])
        db_session.commit()

        self.db_session = db_session