Exemple #1
0
    def setUp(self):
        if self.network and os.getenv('IBID_NETWORKLESS_TEST') is not None:
            raise unittest.SkipTest('test uses network')

        ibid.config = FileConfig(locate_resource('ibid.test', 'test.ini'))

        if self.load_configured is None:
            self.load_configured = not self.load

        if self.load_base:
            if 'core' not in self.load:
                self.load += ['core']
            if 'core.RateLimit' not in self.noload:
                self.noload += ['core.RateLimit']

        self._create_database()

        ibid.reload_reloader()
        ibid.reloader.reload_databases()
        ibid.reloader.reload_dispatcher()
        ibid.reloader.load_processors(self.load, self.noload, self.load_configured)

        ibid.auth = TestAuth()
        self.source = u'test_source_' + unicode(id(self))
        ibid.sources[self.source] = TestSource()

        session = ibid.databases.ibid()

        self.identity = Identity(self.source, self.username)
        session.save(self.identity)
        session.commit()
        self.identity = session.query(Identity) \
            .filter_by(identity=self.username).one()

        session.close()
Exemple #2
0
    def setUp(self):
        super(PluginTestCase, self).setUp()

        if self.load_configured is None:
            self.load_configured = not self.load

        if self.load_base:
            if 'core' not in self.load:
                self.load += ['core']
            if 'core.RateLimit' not in self.noload:
                self.noload += ['core.RateLimit']

        self._create_database()

        ibid.reload_reloader()
        ibid.reloader.reload_databases()
        ibid.reloader.reload_dispatcher()
        ibid.reloader.load_processors(self.load, self.noload, self.load_configured)

        ibid.auth = TestAuth()
        self.source = u'test_source_' + unicode(id(self))
        ibid.sources[self.source] = TestSource()

        session = ibid.databases.ibid()

        self.identity = Identity(self.source, self.username)
        session.save(self.identity)
        session.commit()
        self.identity = session.query(Identity) \
            .filter_by(identity=self.username).one()

        session.close()
Exemple #3
0
    def setUp(self):
        super(PluginTestCase, self).setUp()

        if self.load_configured is None:
            self.load_configured = not self.load

        if self.load_base:
            if 'core' not in self.load:
                self.load += ['core']
            if 'core.RateLimit' not in self.noload:
                self.noload += ['core.RateLimit']

        self._create_database()

        ibid.reload_reloader()
        ibid.reloader.reload_databases()
        ibid.reloader.reload_dispatcher()
        ibid.reloader.load_processors(self.load, self.noload,
                                      self.load_configured)

        ibid.auth = TestAuth()
        self.source = u'test_source_' + unicode(id(self))
        ibid.sources[self.source] = TestSource()

        session = ibid.databases.ibid()

        self.identity = Identity(self.source, self.username)
        session.save(self.identity)
        session.commit()
        self.identity = session.query(Identity) \
            .filter_by(identity=self.username).one()

        session.close()
Exemple #4
0
    def reload(self, event, module):
        module = module.lower()
        if module == 'reloader':
            result = ibid.reload_reloader()
        else:
            result = getattr(ibid.reloader, 'reload_%s' % module)()

        event.addresponse(result and u'%s reloaded' or u"Couldn't reload %s", module)
Exemple #5
0
    def setUp(self):
        super(PluginTestCase, self).setUp()
        if sqlalchemy.__version__ > '0.6.0':
            raise unittest.SkipTest(
                    "PluginTestCase doesn't work with SQLAlchemy 0.6")
        if self.network and os.getenv('IBID_NETWORKLESS_TEST') is not None:
            raise unittest.SkipTest('test uses network')

        ibid.config = FileConfig(locate_resource('ibid.test', 'test.ini'))

        if self.load_configured is None:
            self.load_configured = not self.load

        if self.load_base:
            if 'core' not in self.load:
                self.load += ['core']
            if 'core.RateLimit' not in self.noload:
                self.noload += ['core.RateLimit']

        self._create_database()

        ibid.reload_reloader()
        ibid.reloader.reload_databases()
        ibid.reloader.reload_dispatcher()
        ibid.reloader.load_processors(self.load, self.noload, self.load_configured)

        ibid.auth = TestAuth()
        self.source = u'test_source_' + unicode(id(self))
        ibid.sources[self.source] = TestSource()

        session = ibid.databases.ibid()

        self.identity = Identity(self.source, self.username)
        session.add(self.identity)
        session.commit()
        self.identity = session.query(Identity) \
            .filter_by(identity=self.username).one()

        session.close()
Exemple #6
0
    def setUp(self):
        super(PluginTestCase, self).setUp()
        if sqlalchemy.__version__ > "0.6.0":
            raise unittest.SkipTest("PluginTestCase doesn't work with SQLAlchemy 0.6")
        if self.network and os.getenv("IBID_NETWORKLESS_TEST") is not None:
            raise unittest.SkipTest("test uses network")

        ibid.config = FileConfig(locate_resource("ibid.test", "test.ini"))

        if self.load_configured is None:
            self.load_configured = not self.load

        if self.load_base:
            if "core" not in self.load:
                self.load += ["core"]
            if "core.RateLimit" not in self.noload:
                self.noload += ["core.RateLimit"]

        self._create_database()

        ibid.reload_reloader()
        ibid.reloader.reload_databases()
        ibid.reloader.reload_dispatcher()
        ibid.reloader.load_processors(self.load, self.noload, self.load_configured)

        ibid.auth = TestAuth()
        self.source = u"test_source_" + unicode(id(self))
        ibid.sources[self.source] = TestSource()

        session = ibid.databases.ibid()

        self.identity = Identity(self.source, self.username)
        session.add(self.identity)
        session.commit()
        self.identity = session.query(Identity).filter_by(identity=self.username).one()

        session.close()