Skip to content

Commit eeff14d

Browse files
committed
test: fix path issues posix vs windows in admin functions.
1 parent 17d8e88 commit eeff14d

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

test/test_admin.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -369,17 +369,19 @@ def testInit(self):
369369
self.assertTrue(os.path.isfile(self.dirname + "/config.ini"))
370370
self.assertTrue(os.path.isfile(self.dirname + "/schema.py"))
371371

372+
nopath= '/tmp/noSuchDirectory/nodir'
373+
norealpath = os.path.realpath(nopath + "/..")
372374
self.admin=AdminTool()
373375
with captured_output() as (out, err):
374-
sys.argv=['main', '-i', '/tmp/noSuchDirectory/nodir', 'install', 'classic', self.backend]
376+
sys.argv=['main', '-i', nopath, 'install', 'classic', self.backend]
375377
ret = self.admin.main()
376378

377379
out = out.getvalue().strip()
378380
print(ret)
379381
print(out)
380382
self.assertEqual(ret, 1)
381383
self.assertIn('Error: Instance home parent directory '
382-
'"/tmp/noSuchDirectory" does not exist', out)
384+
'"%s" does not exist' % norealpath, out)
383385

384386
def testInitWithConfig_ini(self):
385387
from roundup.configuration import CoreConfig
@@ -410,7 +412,8 @@ def testInitWithConfig_ini(self):
410412
self.assertTrue(os.path.isfile(self.dirname + "/config.ini"))
411413
self.assertTrue(os.path.isfile(self.dirname + "/schema.py"))
412414
config=CoreConfig(self.dirname)
413-
self.assertEqual(config['MAIL_DEBUG'], self.dirname + "/SendMail.LOG")
415+
self.assertEqual(config['MAIL_DEBUG'],
416+
os.path.normpath(self.dirname + "/SendMail.LOG"))
414417

415418
def testList(self):
416419
''' Note the tests will fail if you run this under pdb.

0 commit comments

Comments
 (0)