tests/test-trusted.py
changeset 8144 fca54469480e
parent 8142 912bfef12ba6
child 8190 9b8ac5fb7760
--- a/tests/test-trusted.py	Thu Apr 23 15:40:10 2009 -0500
+++ b/tests/test-trusted.py	Thu Apr 23 15:40:10 2009 -0500
@@ -3,7 +3,7 @@
 # monkey-patching some functions in the util module
 
 import os
-from mercurial import ui, util
+from mercurial import ui, util, error
 
 hgrc = os.environ['HGRCPATH']
 f = open(hgrc)
@@ -85,7 +85,6 @@
 f = open('.hg/hgrc', 'w')
 f.write('[paths]\n')
 f.write('local = /another/path\n\n')
-f.write('interpolated = %(global)s%(local)s\n\n')
 f.close()
 
 #print '# Everything is run by user foo, group bar\n'
@@ -154,10 +153,8 @@
 u2.readconfig('.hg/hgrc')
 print 'trusted:'
 print u2.config('foobar', 'baz')
-print u2.config('paths', 'interpolated')
 print 'untrusted:'
 print u2.config('foobar', 'baz', untrusted=True)
-print u2.config('paths', 'interpolated', untrusted=True)
 
 print
 print "# error handling"
@@ -179,33 +176,15 @@
 print
 print "# parse error"
 f = open('.hg/hgrc', 'w')
-f.write('foo = bar')
-f.close()
-testui(user='abc', group='def', silent=True)
-assertraises(lambda: testui(debug=True, silent=True))
-
-print
-print "# interpolation error"
-f = open('.hg/hgrc', 'w')
-f.write('[foo]\n')
-f.write('bar = %(')
+f.write('foo')
 f.close()
-u = testui(debug=True, silent=True)
-print '# regular config:'
-print '  trusted',
-assertraises(lambda: u.config('foo', 'bar'))
-print 'untrusted',
-assertraises(lambda: u.config('foo', 'bar', untrusted=True))
 
-u = testui(user='abc', group='def', debug=True, silent=True)
-print '  trusted ',
-print u.config('foo', 'bar')
-print 'untrusted',
-assertraises(lambda: u.config('foo', 'bar', untrusted=True))
+try:
+    testui(user='abc', group='def', silent=True)
+except error.ConfigError, inst:
+    print inst
 
-print '# configitems:'
-print '  trusted ',
-print u.configitems('foo')
-print 'untrusted',
-assertraises(lambda: u.configitems('foo', untrusted=True))
-
+try:
+    testui(debug=True, silent=True)
+except error.ConfigError, inst:
+    print inst