Mercurial > p > roundup > code
view test/test_instance.py @ 6672:01216187a167
Testing translations in mailgw.py, update translations, i18n improved
i18n.py: translation objects get a _file which is the file that catalog
was loaded from. Useful for debugging.
mailgw.py: fix code to include roundup.i18n and invoke propert method.
GNUMakefile: added roundup.pot target. Also building roundup.pot sets
the release version and product code in roundup.pot.
Release version from roundup.__init__.py.
merged roundup.pot changes into all *.po files. Not sure if the
version info in the headers of the .po files is supposed to be
updated to match roundup.pot or not.
test_mailgw.py: test cases for en and de translations tested. Not sure
why I neede to set roundupdb._ and mailgw._, but followed setUp
method code and it worked.
| author | John Rouillard <rouilj@ieee.org> |
|---|---|
| date | Wed, 11 May 2022 21:20:34 -0400 |
| parents | 778a9f455067 |
| children | 9c3ec0a5c7fc |
line wrap: on
line source
# # Copyright (C) 2020 John Rouillard # All rights reserved. # For license terms see the file COPYING.txt. # from __future__ import print_function import unittest, os, shutil, errno, sys, difflib from roundup import instance from roundup.instance import TrackerError try: # python2 import pathlib2 as pathlib except ImportError: # python3 import pathlib from . import db_test_base class InstanceTest(unittest.TestCase): backend = 'anydbm' def setUp(self): self.dirname = '_test_instance' # set up and open a tracker self.instance = db_test_base.setupTracker(self.dirname, self.backend) # open the database self.db = self.instance.open('admin') self.db.commit() self.db.close() def tearDown(self): if self.db: self.db.close() try: shutil.rmtree(self.dirname) except OSError as error: if error.errno not in (errno.ENOENT, errno.ESRCH): raise def testOpenOldStyle(self): pathlib.Path(os.path.join(self.dirname, "dbinit.py")).touch() # no longer support old style tracker configs self.assertRaises(TrackerError, instance.open, self.dirname)
