提交 4fe672cd 编写于 作者: C Cleber Rosa

test_mux.TestMuxTree.test_basic_functions: get a string on Python 3

And not bytes.  What happens here is that
`avocado.core.tree.tree_view()` will return either bytes with 'utf-8'
or 'ascii' depending on the given parameter.

On Python 2, it's fine to compare the result with strings.  On Python
3, we have to get a string from the bytes returned, that is, we need
to decode the bytes.

While at it, let's fix a typo (s/asci/ascii).
Signed-off-by: NCleber Rosa <crosa@redhat.com>
上级 8c095e96
......@@ -127,9 +127,9 @@ class TestMuxTree(unittest.TestCase):
'prod']
self.assertEqual(leaves, self.tree.get_leaves())
# ascii contain all leaves and doesn't raise any exceptions
ascii = tree.tree_view(self.tree, 0, False)
ascii = tree.tree_view(self.tree, 0, False).decode('ascii')
for leaf in leaves:
self.assertIn(leaf, ascii, "Leaf %s not in asci:\n%s"
self.assertIn(leaf, ascii, "Leaf %s not in ascii:\n%s"
% (leaf, ascii))
def test_filters(self):
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册