This revision was automatically updated to reflect the committed changes.
Closed by commit rHG3740d1abde44: py3: add b'' prefixes in 
tests/test-ui-config.py (authored by pulkit, committed by ).

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D3221?vs=7933&id=7965

REVISION DETAIL
  https://phab.mercurial-scm.org/D3221

AFFECTED FILES
  tests/test-ui-config.py

CHANGE DETAILS

diff --git a/tests/test-ui-config.py b/tests/test-ui-config.py
--- a/tests/test-ui-config.py
+++ b/tests/test-ui-config.py
@@ -12,111 +12,111 @@
 # the purpose of this test is to check the old behavior, not to validate the
 # behavior from registered item. so we silent warning related to unregisted
 # config.
-testui.setconfig('devel', 'warn-config-unknown', False, 'test')
-testui.setconfig('devel', 'all-warnings', False, 'test')
+testui.setconfig(b'devel', b'warn-config-unknown', False, b'test')
+testui.setconfig(b'devel', b'all-warnings', False, b'test')
 
 parsed = dispatch._parseconfig(testui, [
-    'values.string=string value',
-    'values.bool1=true',
-    'values.bool2=false',
-    'values.boolinvalid=foo',
-    'values.int1=42',
-    'values.int2=-42',
-    'values.intinvalid=foo',
-    'lists.list1=foo',
-    'lists.list2=foo bar baz',
-    'lists.list3=alice, bob',
-    'lists.list4=foo bar baz alice, bob',
-    'lists.list5=abc d"ef"g "hij def"',
-    'lists.list6="hello world", "how are you?"',
-    'lists.list7=Do"Not"Separate',
-    'lists.list8="Do"Separate',
-    'lists.list9="Do\\"NotSeparate"',
-    'lists.list10=string "with extraneous" quotation mark"',
-    'lists.list11=x, y',
-    'lists.list12="x", "y"',
-    'lists.list13=""" key = "x", "y" """',
-    'lists.list14=,,,,     ',
-    'lists.list15=" just with starting quotation',
-    'lists.list16="longer quotation" with "no ending quotation',
-    'lists.list17=this is \\" "not a quotation mark"',
-    'lists.list18=\n \n\nding\ndong',
-    'date.epoch=0 0',
-    'date.birth=2005-04-19T00:00:00',
-    'date.invalid=0'
+    b'values.string=string value',
+    b'values.bool1=true',
+    b'values.bool2=false',
+    b'values.boolinvalid=foo',
+    b'values.int1=42',
+    b'values.int2=-42',
+    b'values.intinvalid=foo',
+    b'lists.list1=foo',
+    b'lists.list2=foo bar baz',
+    b'lists.list3=alice, bob',
+    b'lists.list4=foo bar baz alice, bob',
+    b'lists.list5=abc d"ef"g "hij def"',
+    b'lists.list6="hello world", "how are you?"',
+    b'lists.list7=Do"Not"Separate',
+    b'lists.list8="Do"Separate',
+    b'lists.list9="Do\\"NotSeparate"',
+    b'lists.list10=string "with extraneous" quotation mark"',
+    b'lists.list11=x, y',
+    b'lists.list12="x", "y"',
+    b'lists.list13=""" key = "x", "y" """',
+    b'lists.list14=,,,,     ',
+    b'lists.list15=" just with starting quotation',
+    b'lists.list16="longer quotation" with "no ending quotation',
+    b'lists.list17=this is \\" "not a quotation mark"',
+    b'lists.list18=\n \n\nding\ndong',
+    b'date.epoch=0 0',
+    b'date.birth=2005-04-19T00:00:00',
+    b'date.invalid=0'
     ])
 
-print(repr(testui.configitems('values')))
-print(repr(testui.configitems('lists')))
+print(repr(testui.configitems(b'values')))
+print(repr(testui.configitems(b'lists')))
 print("---")
-print(repr(testui.config('values', 'string')))
-print(repr(testui.config('values', 'bool1')))
-print(repr(testui.config('values', 'bool2')))
-print(repr(testui.config('values', 'unknown')))
+print(repr(testui.config(b'values', b'string')))
+print(repr(testui.config(b'values', b'bool1')))
+print(repr(testui.config(b'values', b'bool2')))
+print(repr(testui.config(b'values', b'unknown')))
 print("---")
 try:
-    print(repr(testui.configbool('values', 'string')))
+    print(repr(testui.configbool(b'values', b'string')))
 except error.ConfigError as inst:
     print(inst)
-print(repr(testui.configbool('values', 'bool1')))
-print(repr(testui.configbool('values', 'bool2')))
-print(repr(testui.configbool('values', 'bool2', True)))
-print(repr(testui.configbool('values', 'unknown')))
-print(repr(testui.configbool('values', 'unknown', True)))
+print(repr(testui.configbool(b'values', b'bool1')))
+print(repr(testui.configbool(b'values', b'bool2')))
+print(repr(testui.configbool(b'values', b'bool2', True)))
+print(repr(testui.configbool(b'values', b'unknown')))
+print(repr(testui.configbool(b'values', b'unknown', True)))
 print("---")
-print(repr(testui.configint('values', 'int1')))
-print(repr(testui.configint('values', 'int2')))
+print(repr(testui.configint(b'values', b'int1')))
+print(repr(testui.configint(b'values', b'int2')))
 print("---")
-print(repr(testui.configlist('lists', 'list1')))
-print(repr(testui.configlist('lists', 'list2')))
-print(repr(testui.configlist('lists', 'list3')))
-print(repr(testui.configlist('lists', 'list4')))
-print(repr(testui.configlist('lists', 'list4', ['foo'])))
-print(repr(testui.configlist('lists', 'list5')))
-print(repr(testui.configlist('lists', 'list6')))
-print(repr(testui.configlist('lists', 'list7')))
-print(repr(testui.configlist('lists', 'list8')))
-print(repr(testui.configlist('lists', 'list9')))
-print(repr(testui.configlist('lists', 'list10')))
-print(repr(testui.configlist('lists', 'list11')))
-print(repr(testui.configlist('lists', 'list12')))
-print(repr(testui.configlist('lists', 'list13')))
-print(repr(testui.configlist('lists', 'list14')))
-print(repr(testui.configlist('lists', 'list15')))
-print(repr(testui.configlist('lists', 'list16')))
-print(repr(testui.configlist('lists', 'list17')))
-print(repr(testui.configlist('lists', 'list18')))
-print(repr(testui.configlist('lists', 'unknown')))
-print(repr(testui.configlist('lists', 'unknown', '')))
-print(repr(testui.configlist('lists', 'unknown', 'foo')))
-print(repr(testui.configlist('lists', 'unknown', ['foo'])))
-print(repr(testui.configlist('lists', 'unknown', 'foo bar')))
-print(repr(testui.configlist('lists', 'unknown', 'foo, bar')))
-print(repr(testui.configlist('lists', 'unknown', ['foo bar'])))
-print(repr(testui.configlist('lists', 'unknown', ['foo', 'bar'])))
+print(repr(testui.configlist(b'lists', b'list1')))
+print(repr(testui.configlist(b'lists', b'list2')))
+print(repr(testui.configlist(b'lists', b'list3')))
+print(repr(testui.configlist(b'lists', b'list4')))
+print(repr(testui.configlist(b'lists', b'list4', [b'foo'])))
+print(repr(testui.configlist(b'lists', b'list5')))
+print(repr(testui.configlist(b'lists', b'list6')))
+print(repr(testui.configlist(b'lists', b'list7')))
+print(repr(testui.configlist(b'lists', b'list8')))
+print(repr(testui.configlist(b'lists', b'list9')))
+print(repr(testui.configlist(b'lists', b'list10')))
+print(repr(testui.configlist(b'lists', b'list11')))
+print(repr(testui.configlist(b'lists', b'list12')))
+print(repr(testui.configlist(b'lists', b'list13')))
+print(repr(testui.configlist(b'lists', b'list14')))
+print(repr(testui.configlist(b'lists', b'list15')))
+print(repr(testui.configlist(b'lists', b'list16')))
+print(repr(testui.configlist(b'lists', b'list17')))
+print(repr(testui.configlist(b'lists', b'list18')))
+print(repr(testui.configlist(b'lists', b'unknown')))
+print(repr(testui.configlist(b'lists', b'unknown', b'')))
+print(repr(testui.configlist(b'lists', b'unknown', b'foo')))
+print(repr(testui.configlist(b'lists', b'unknown', [b'foo'])))
+print(repr(testui.configlist(b'lists', b'unknown', b'foo bar')))
+print(repr(testui.configlist(b'lists', b'unknown', b'foo, bar')))
+print(repr(testui.configlist(b'lists', b'unknown', [b'foo bar'])))
+print(repr(testui.configlist(b'lists', b'unknown', [b'foo', b'bar'])))
 print("---")
-print(repr(testui.configdate('date', 'epoch')))
-print(repr(testui.configdate('date', 'birth')))
+print(repr(testui.configdate(b'date', b'epoch')))
+print(repr(testui.configdate(b'date', b'birth')))
 
-print(repr(testui.config('values', 'String')))
+print(repr(testui.config(b'values', b'String')))
 
 def function():
     pass
 
 # values that aren't strings should work
-testui.setconfig('hook', 'commit', function)
-print(function == testui.config('hook', 'commit'))
+testui.setconfig(b'hook', b'commit', function)
+print(function == testui.config(b'hook', b'commit'))
 
 # invalid values
 try:
-    testui.configbool('values', 'boolinvalid')
+    testui.configbool(b'values', b'boolinvalid')
 except error.ConfigError:
     print('boolinvalid')
 try:
-    testui.configint('values', 'intinvalid')
+    testui.configint(b'values', b'intinvalid')
 except error.ConfigError:
     print('intinvalid')
 try:
-    testui.configdate('date', 'invalid')
+    testui.configdate(b'date', b'invalid')
 except error.ConfigError:
     print('dateinvalid')



To: pulkit, #hg-reviewers
Cc: mercurial-devel
_______________________________________________
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel

Reply via email to