Esempio n. 1
0
    def buildStoreAndDirectory(self,
                               accounts=None,
                               resources=None,
                               augments=None,
                               proxies=None,
                               extraUids=None,
                               serversDB=None):

        self.serverRoot = self.mktemp()
        os.mkdir(self.serverRoot)

        self.counter = 0
        self.notifierFactory = StubNotifierFactory()

        config.reset()
        self.configure()

        self.store = yield self.buildStore()
        self._sqlCalendarStore = self.store  # FIXME: remove references to this

        self.directory = buildTestDirectory(self.store,
                                            config.DataRoot,
                                            accounts=accounts,
                                            resources=resources,
                                            augments=augments,
                                            proxies=proxies,
                                            serversDB=serversDB)
        if extraUids:
            for uid in extraUids:
                yield self.addRecordFromFields({
                    self.directory.fieldName.uid:
                    uid,
                    self.directory.fieldName.recordType:
                    self.directory.recordType.user,
                })
Esempio n. 2
0
    def setUp(self):
        super(TestCase, self).setUp()

        # FIXME: this is only here to workaround circular imports
        doBind()

        config.reset()
        serverroot = self.mktemp()
        os.mkdir(serverroot)
        config.ServerRoot = os.path.abspath(serverroot)
        config.ConfigRoot = "config"
        config.LogRoot = "logs"
        config.RunRoot = "logs"

        if not os.path.exists(config.DataRoot):
            os.makedirs(config.DataRoot)
        if not os.path.exists(config.DocumentRoot):
            os.makedirs(config.DocumentRoot)
        if not os.path.exists(config.ConfigRoot):
            os.makedirs(config.ConfigRoot)
        if not os.path.exists(config.LogRoot):
            os.makedirs(config.LogRoot)

        config.Memcached.Pools.Default.ClientEnabled = False
        config.Memcached.Pools.Default.ServerEnabled = False
        ClientFactory.allowTestCache = True
        memcacher.Memcacher.allowTestCache = True

        config.DirectoryAddressBook.Enabled = False
Esempio n. 3
0
    def buildStoreAndDirectory(
        self, accounts=None, resources=None, augments=None, proxies=None,
        extraUids=None, serversDB=None
    ):

        self.serverRoot = self.mktemp()
        os.mkdir(self.serverRoot)

        self.counter = 0
        self.notifierFactory = StubNotifierFactory()

        config.reset()
        self.configure()

        self.store = yield self.buildStore()
        self._sqlCalendarStore = self.store  # FIXME: remove references to this

        self.directory = buildTestDirectory(
            self.store, config.DataRoot,
            accounts=accounts, resources=resources,
            augments=augments, proxies=proxies,
            serversDB=serversDB
        )
        if extraUids:
            for uid in extraUids:
                yield self.addRecordFromFields(
                    {
                        self.directory.fieldName.uid:
                            uid,
                        self.directory.fieldName.recordType:
                            self.directory.recordType.user,
                    }
                )
Esempio n. 4
0
    def setUp(self):
        super(TestCase, self).setUp()

        config.reset()
        serverroot = self.mktemp()
        os.mkdir(serverroot)
        config.ServerRoot = serverroot
        config.ConfigRoot = "config"
        
        if not os.path.exists(config.DataRoot):
            os.makedirs(config.DataRoot)
        if not os.path.exists(config.DocumentRoot):
            os.makedirs(config.DocumentRoot)
        if not os.path.exists(config.ConfigRoot):
            os.makedirs(config.ConfigRoot)

        config.Memcached.Pools.Default.ClientEnabled = False
        config.Memcached.Pools.Default.ServerEnabled = False
        ClientFactory.allowTestCache = True
        memcacher.Memcacher.allowTestCache = True

        config.DirectoryAddressBook.Enabled = False
Esempio n. 5
0
 def tearDown(self):
     config.setDefaults(DEFAULT_CONFIG)
     config.reset()
 def tearDown(self):
     config.setDefaults(DEFAULT_CONFIG)
     config.reset()