mirror of
https://github.com/samba-team/samba.git
synced 2025-07-29 15:42:04 +03:00
python/samba/tests: Py2/Py2 enable samba.tests.samba_tool.help to run
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>
This commit is contained in:
committed by
Andrew Bartlett
parent
4188a02bc2
commit
f86693c84c
@ -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:
|
||||
|
Reference in New Issue
Block a user