~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/selftest/__init__.py

  • Committer: Robert Collins
  • Date: 2005-10-17 11:41:07 UTC
  • mfrom: (1442.1.60)
  • Revision ID: robertc@robertcollins.net-20051017114107-f5586285d825c105
Merge in first part of GPG support.

This adds check_signatures config support, triams back the transport api
to be leaner and easier to hook in suffixes - non primary streams in the store
associated with the fileid that primary data is stored in, a gpg module which
will encapsulate all signing and checking operations.

Show diffs side-by-side

added added

removed removed

Lines of Context:
166
166
 
167
167
    def setUp(self):
168
168
        unittest.TestCase.setUp(self)
 
169
        self.oldenv = os.environ.get('HOME', None)
 
170
        os.environ['HOME'] = os.getcwd()
 
171
        self.bzr_email = os.environ.get('BZREMAIL')
 
172
        if self.bzr_email is not None:
 
173
            del os.environ['BZREMAIL']
 
174
        self.email = os.environ.get('EMAIL')
 
175
        if self.email is not None:
 
176
            del os.environ['EMAIL']
169
177
        bzrlib.trace.disable_default_logging()
170
178
        self._enable_file_logging()
171
179
 
205
213
        self._log_file_name = name
206
214
 
207
215
    def tearDown(self):
 
216
        os.environ['HOME'] = self.oldenv
 
217
        if os.environ.get('BZREMAIL') is not None:
 
218
            del os.environ['BZREMAIL']
 
219
        if self.bzr_email is not None:
 
220
            os.environ['BZREMAIL'] = self.bzr_email
 
221
        if os.environ.get('EMAIL') is not None:
 
222
            del os.environ['EMAIL']
 
223
        if self.email is not None:
 
224
            os.environ['EMAIL'] = self.email
208
225
        logging.getLogger('').removeHandler(self._log_hdlr)
209
226
        bzrlib.trace.enable_default_logging()
210
227
        logging.debug('%s teardown', self.id())
385
402
        os.mkdir(os.path.join(TestCaseInTempDir.TEST_ROOT, '.bzr'))
386
403
 
387
404
    def setUp(self):
388
 
        super(TestCaseInTempDir, self).setUp()
389
405
        self._make_test_root()
390
406
        self._currentdir = os.getcwdu()
391
407
        short_id = self.id().replace('bzrlib.selftest.', '') \
393
409
        self.test_dir = os.path.join(self.TEST_ROOT, short_id)
394
410
        os.mkdir(self.test_dir)
395
411
        os.chdir(self.test_dir)
 
412
        super(TestCaseInTempDir, self).setUp()
396
413
        
397
414
    def tearDown(self):
398
415
        os.chdir(self._currentdir)
477
494
 
478
495
    testmod_names = \
479
496
                  ['bzrlib.selftest.MetaTestLog',
 
497
                   'bzrlib.selftest.testgpg',
480
498
                   'bzrlib.selftest.testidentitymap',
481
499
                   'bzrlib.selftest.testinv',
482
500
                   'bzrlib.selftest.test_ancestry',