Ejemplo n.º 1
0
    def testThreadStopsInFS(self):
        dbManagerClass = DbManager
        dbManagerClass._loadDbs = lambda x: None
        dbManager = DbManager()
        changes_controller = ChangeController()
        mapper = mock()
        fsController = dbManager.createDb('testWkspc', DBTYPE.FS)

        fsController.saveDocument({'_id': 'testwkspc', 'type': 'workspace'})

        changes_controller.watch(mapper, fsController)
        self.assertTrue(changes_controller.isAlive())

        changes_controller.unwatch()
        self.assertFalse(changes_controller.isAlive())
Ejemplo n.º 2
0
    def testThreadStopsInFS(self):
        dbManagerClass = DbManager
        dbManagerClass._loadDbs = lambda x: None
        dbManager = DbManager()
        changes_controller = ChangeController()
        mapper = mock()
        fsController = dbManager.createDb('testWkspc', DBTYPE.FS)
        
        fsController.saveDocument({'_id':'testwkspc',
                                    'type':'workspace' })

        changes_controller.watch(mapper, fsController)
        self.assertTrue(changes_controller.isAlive())

        changes_controller.unwatch()
        self.assertFalse(changes_controller.isAlive())
Ejemplo n.º 3
0
    def testThreadStops(self):
        changes_controller = ChangeController()
        mapper = mock()
        uri = CONF.getCouchURI()
        url = urlparse(uri)
        getLogger(self).debug(
            "Setting user,pass %s %s" % (url.username, url.password))
        self.cdbManager = CouchDbManager(uri=uri)
        
        dbCouchController = self.cdbManager.createDb('testWkspc')
        dbCouchController.saveDocument({'_id':'testwkspc',
                                    'type':'workspace' })

        changes_controller.watch(mapper, dbCouchController)
        self.assertTrue(changes_controller.isAlive())

        changes_controller.unwatch()
        self.assertFalse(changes_controller.isAlive())
Ejemplo n.º 4
0
    def testThreadStops(self):
        changes_controller = ChangeController()
        mapper = mock()
        uri = CONF.getCouchURI()
        url = urlparse(uri)
        getLogger(self).debug("Setting user,pass %s %s" %
                              (url.username, url.password))
        self.cdbManager = CouchDbManager(uri=uri)

        dbCouchController = self.cdbManager.createDb('testWkspc')
        dbCouchController.saveDocument({
            '_id': 'testwkspc',
            'type': 'workspace'
        })

        changes_controller.watch(mapper, dbCouchController)
        self.assertTrue(changes_controller.isAlive())

        changes_controller.unwatch()
        self.assertFalse(changes_controller.isAlive())