Mercurial > p > roundup > code
changeset 7883:23b7669b2f48
test: fix path issues posix vs windows in admin functions.
| author | John Rouillard <rouilj@ieee.org> |
|---|---|
| date | Thu, 18 Apr 2024 19:53:50 -0400 |
| parents | 77c109725a7e |
| children | 88a2a6079a89 |
| files | test/test_admin.py |
| diffstat | 1 files changed, 6 insertions(+), 3 deletions(-) [+] |
line wrap: on
line diff
--- a/test/test_admin.py Thu Apr 18 19:36:32 2024 -0400 +++ b/test/test_admin.py Thu Apr 18 19:53:50 2024 -0400 @@ -369,9 +369,11 @@ self.assertTrue(os.path.isfile(self.dirname + "/config.ini")) self.assertTrue(os.path.isfile(self.dirname + "/schema.py")) + nopath= '/tmp/noSuchDirectory/nodir' + norealpath = os.path.realpath(nopath + "/..") self.admin=AdminTool() with captured_output() as (out, err): - sys.argv=['main', '-i', '/tmp/noSuchDirectory/nodir', 'install', 'classic', self.backend] + sys.argv=['main', '-i', nopath, 'install', 'classic', self.backend] ret = self.admin.main() out = out.getvalue().strip() @@ -379,7 +381,7 @@ print(out) self.assertEqual(ret, 1) self.assertIn('Error: Instance home parent directory ' - '"/tmp/noSuchDirectory" does not exist', out) + '"%s" does not exist' % norealpath, out) def testInitWithConfig_ini(self): from roundup.configuration import CoreConfig @@ -410,7 +412,8 @@ self.assertTrue(os.path.isfile(self.dirname + "/config.ini")) self.assertTrue(os.path.isfile(self.dirname + "/schema.py")) config=CoreConfig(self.dirname) - self.assertEqual(config['MAIL_DEBUG'], self.dirname + "/SendMail.LOG") + self.assertEqual(config['MAIL_DEBUG'], + os.path.normpath(self.dirname + "/SendMail.LOG")) def testList(self): ''' Note the tests will fail if you run this under pdb.
