Ejemplo n.º 1
0
 def cleanUp(self):
     """Shut downs both librarian instances."""
     if self._persistent_servers():
         return
     if not self._setup:
         warnings.warn("Attempt to tearDown inactive fixture.",
             DeprecationWarning, stacklevel=3)
         return
     TacTestSetup.cleanUp(self)
Ejemplo n.º 2
0
    def setUp(self):
        """Start both librarian instances."""
        if (self._persistent_servers() and self.pid):
            return
        else:
            # self.pid may have been evaluated - nuke it.
            self._pid = None
        # The try:except here can be removed if someone audits the callers to
        # make sure that they call cleanUp if setUp fails.
        try:
            TacTestSetup.setUp(self)
        except TacException:
            self.cleanUp()
            raise
        else:
            self._pid = self._read_pid()
        self._setup = True
        self.addCleanup(setattr, self, '_setup', False)

        # Update the config our tests are using to know about the
        # correct ports.
        self.config_fixture.add_section(self.service_config)
        config.reloadConfig()