From: Felix Schwarz Date: Mon, 23 Jul 2012 18:55:56 +0000 (+0000) Subject: change frontend tests so that they can be run stand-alone (using "python babel/messag... X-Git-Tag: 1.0~174 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=2f322fe7ff0b39f7dad91619853827cfc0af5fe3;p=thirdparty%2Fbabel.git change frontend tests so that they can be run stand-alone (using "python babel/messages/tests/frontend.py") and not just as part of the whole suite --- diff --git a/babel/messages/tests/frontend.py b/babel/messages/tests/frontend.py index 7a2cdfa5..7aac2ecd 100644 --- a/babel/messages/tests/frontend.py +++ b/babel/messages/tests/frontend.py @@ -30,11 +30,13 @@ from babel.messages import frontend from babel.util import LOCALTZ +this_dir = os.path.abspath(os.path.dirname(__file__)) + class CompileCatalogTestCase(unittest.TestCase): def setUp(self): self.olddir = os.getcwd() - self.datadir = os.path.join(os.path.dirname(__file__), 'data') + self.datadir = os.path.join(this_dir, 'data') os.chdir(self.datadir) _global_log.threshold = 5 # shut up distutils logging @@ -64,7 +66,7 @@ class ExtractMessagesTestCase(unittest.TestCase): def setUp(self): self.olddir = os.getcwd() - self.datadir = os.path.join(os.path.dirname(__file__), 'data') + self.datadir = os.path.join(this_dir, 'data') os.chdir(self.datadir) _global_log.threshold = 5 # shut up distutils logging @@ -274,7 +276,7 @@ class InitCatalogTestCase(unittest.TestCase): def setUp(self): self.olddir = os.getcwd() - self.datadir = os.path.join(os.path.dirname(__file__), 'data') + self.datadir = os.path.join(this_dir, 'data') os.chdir(self.datadir) _global_log.threshold = 5 # shut up distutils logging @@ -512,7 +514,7 @@ msgstr[0] "" class CommandLineInterfaceTestCase(unittest.TestCase): def setUp(self): - self.datadir = os.path.join(os.path.dirname(__file__), 'data') + self.datadir = os.path.join(this_dir, 'data') self.orig_working_dir = os.getcwd() self.orig_argv = sys.argv self.orig_stdout = sys.stdout