24
24
import sys
25
25
import unittest
26
26
27
+ from os .path import normpath
28
+
27
29
from roundup import configuration
28
30
from roundup .backends import get_backend , have_backend
29
31
from roundup .hyperdb import DatabaseError
@@ -218,14 +220,15 @@ def testWebSecretKey(self):
218
220
def testStaticFiles (self ):
219
221
config = configuration .CoreConfig ()
220
222
223
+
224
+ if ("/tmp/bar" == normpath ("/tmp/bar/" )):
225
+ result_list = ["./foo" , "/tmp/bar" ]
226
+ else :
227
+ result_list = [".\\ foo" , "\\ tmp\\ bar" ]
221
228
self .assertEqual (None ,
222
229
config ._get_option ('STATIC_FILES' ).set ("foo /tmp/bar" ))
223
-
224
- self .assertEqual (config .STATIC_FILES ,
225
- ["./foo" , "/tmp/bar" ])
226
-
227
- self .assertEqual (config ['STATIC_FILES' ],
228
- ["./foo" , "/tmp/bar" ])
230
+ print (config .STATIC_FILES )
231
+ self .assertEqual (config .STATIC_FILES , result_list )
229
232
230
233
def testIsolationLevel (self ):
231
234
config = configuration .CoreConfig ()
@@ -982,7 +985,7 @@ def testConfigValueInterpolateError(self):
982
985
983
986
print (cm .exception )
984
987
self .assertIn ("'%' must be followed by '%' or '(', found: '% is invalid'" , cm .exception .args [0 ])
985
- self .assertIn ("_test_instance/config.ini with section [main] at option admin_email" , cm .exception .args [0 ])
988
+ self .assertIn (normpath ( "_test_instance/config.ini" ) + " with section [main] at option admin_email" , cm .exception .args [0 ])
986
989
987
990
988
991
from roundup .admin import AdminTool
@@ -993,7 +996,11 @@ def testConfigValueInterpolateError(self):
993
996
sys .argv = ['main' , '-i' , self .dirname , 'get' , 'tile' , 'issue1' ]
994
997
ret = admin .main ()
995
998
996
- expected_err = "Error in _test_instance/config.ini with section [main] at option admin_email: '%' must be followed by '%' or '(', found: '% is invalid'"
999
+ expected_err = ("Error in " +
1000
+ normpath ("_test_instance/config.ini" ) +
1001
+ " with section [main] at option admin_email: '%' "
1002
+ "must be followed by '%' or '(', found: "
1003
+ "'% is invalid'" )
997
1004
998
1005
self .assertEqual (ret , 1 )
999
1006
out = out .getvalue ().strip ()
0 commit comments