Support python 3
Signed-off-by: Daniel Nephin <dnephin@gmail.com>
This commit is contained in:
parent
17682c58db
commit
809443d6d0
23 changed files with 128 additions and 85 deletions
|
|
@ -3,6 +3,8 @@ from __future__ import unicode_literals
|
|||
|
||||
import os
|
||||
|
||||
import six
|
||||
|
||||
from .. import unittest
|
||||
from compose.cli.log_printer import LogPrinter
|
||||
|
||||
|
|
@ -30,16 +32,17 @@ class LogPrinterTest(unittest.TestCase):
|
|||
output = self.get_default_output()
|
||||
self.assertIn('\033[', output)
|
||||
|
||||
@unittest.skipIf(six.PY3, "Only test unicode in python2")
|
||||
def test_unicode(self):
|
||||
glyph = u'\u2022'.encode('utf-8')
|
||||
glyph = u'\u2022'
|
||||
|
||||
def reader(*args, **kwargs):
|
||||
yield glyph + b'\n'
|
||||
yield glyph + '\n'
|
||||
|
||||
container = MockContainer(reader)
|
||||
output = run_log_printer([container])
|
||||
|
||||
self.assertIn(glyph, output)
|
||||
self.assertIn(glyph, output.decode('utf-8'))
|
||||
|
||||
|
||||
def run_log_printer(containers, monochrome=False):
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue