python/samba/tests: Py2/Py2 enable samba.tests.samba_tool.help to run
authorNoel Power <noel.power@suse.com>
Mon, 13 Aug 2018 16:25:37 +0000 (17:25 +0100)
committerAndrew Bartlett <abartlet@samba.org>
Mon, 3 Sep 2018 01:22:23 +0000 (03:22 +0200)
Ensure bytes output is converted to text type for PY3

Signed-off-by: Noel Power <noel.power@suse.com>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
python/samba/tests/samba_tool/help.py

index 62e0b3eaa23d7f13b657e1ed9509236e5ebfe1c6..db70f6173555d5902d216902345d10384bd641ec 100644 (file)
@@ -20,7 +20,7 @@
 import re
 from samba.tests.samba_tool.base import SambaToolCmdTest
 from samba.tests import BlackboxProcessError
-
+from samba.compat import get_string
 
 class HelpTestCase(SambaToolCmdTest):
     """Tests for samba-tool help and --help
@@ -47,7 +47,7 @@ class HelpTestCase(SambaToolCmdTest):
                 except BlackboxProcessError as e:
                     output = e.stdout
                     failed_commands.append(c)
-
+                output = get_string(output)
                 tail = output.partition('Available subcommands:')[2]
                 subcommands = re.findall(r'^\s*([\w-]+)\s+-', tail,
                                          re.MULTILINE)
@@ -62,6 +62,7 @@ class HelpTestCase(SambaToolCmdTest):
                     output2 = e.stdout
                     failed_commands.append(c)
 
+                output2 = get_string(output2)
                 self.assertEqual(output, output2)
 
             if not new_commands: