tests/test-trusted.py
changeset 31857 08fbc97d1364
parent 31472 75e4bae56068
child 34858 85a2db47ad50
--- a/tests/test-trusted.py	Sun Apr 09 12:53:31 2017 -0700
+++ b/tests/test-trusted.py	Sun Apr 09 22:19:27 2017 -0400
@@ -74,14 +74,14 @@
         return u
     print('trusted')
     for name, path in u.configitems('paths'):
-        print('   ', name, '=', path)
+        print('   ', name, '=', util.pconvert(path))
     print('untrusted')
     for name, path in u.configitems('paths', untrusted=True):
         print('.', end=' ')
         u.config('paths', name) # warning with debug=True
         print('.', end=' ')
         u.config('paths', name, untrusted=True) # no warnings
-        print(name, '=', path)
+        print(name, '=', util.pconvert(path))
     print()
 
     return u
@@ -217,6 +217,12 @@
 list=spam,ham,eggs
 ''')
 u = testui(user='abc', group='def', cuser='foo', silent=True)
+def configpath(section, name, default=None, untrusted=False):
+    path = u.configpath(section, name, default, untrusted)
+    if path is None:
+        return None
+    return util.pconvert(path)
+
 print('# suboptions, trusted and untrusted')
 trusted = u.configsuboptions('foo', 'sub')
 untrusted = u.configsuboptions('foo', 'sub', untrusted=True)
@@ -224,7 +230,7 @@
     (trusted[0], sorted(trusted[1].items())),
     (untrusted[0], sorted(untrusted[1].items())))
 print('# path, trusted and untrusted')
-print(u.configpath('foo', 'path'), u.configpath('foo', 'path', untrusted=True))
+print(configpath('foo', 'path'), configpath('foo', 'path', untrusted=True))
 print('# bool, trusted and untrusted')
 print(u.configbool('foo', 'bool'), u.configbool('foo', 'bool', untrusted=True))
 print('# int, trusted and untrusted')