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,9 +3,8 @@ from __future__ import unicode_literals
|
|||
|
||||
import os
|
||||
|
||||
import mock
|
||||
|
||||
from compose.cli import docker_client
|
||||
from tests import mock
|
||||
from tests import unittest
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -1,6 +1,8 @@
|
|||
from __future__ import absolute_import
|
||||
from __future__ import unicode_literals
|
||||
|
||||
import six
|
||||
|
||||
from compose.cli import verbose_proxy
|
||||
from tests import unittest
|
||||
|
||||
|
|
@ -8,7 +10,8 @@ from tests import unittest
|
|||
class VerboseProxyTestCase(unittest.TestCase):
|
||||
|
||||
def test_format_call(self):
|
||||
expected = "(u'arg1', True, key=u'value')"
|
||||
prefix = '' if six.PY3 else 'u'
|
||||
expected = "(%(p)s'arg1', True, key=%(p)s'value')" % dict(p=prefix)
|
||||
actual = verbose_proxy.format_call(
|
||||
("arg1", True),
|
||||
{'key': 'value'})
|
||||
|
|
@ -21,7 +24,7 @@ class VerboseProxyTestCase(unittest.TestCase):
|
|||
self.assertEqual(expected, actual)
|
||||
|
||||
def test_format_return(self):
|
||||
expected = "{u'Id': u'ok'}"
|
||||
expected = repr({'Id': 'ok'})
|
||||
actual = verbose_proxy.format_return({'Id': 'ok'}, 2)
|
||||
self.assertEqual(expected, actual)
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue