-
Notifications
You must be signed in to change notification settings - Fork 1.7k
support Python 3.5 #1071
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
support Python 3.5 #1071
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
FROM python:3.4 | ||
FROM python:3.5 | ||
MAINTAINER Joffrey F <joffrey@docker.com> | ||
|
||
RUN mkdir /home/docker-py | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
mock==1.0.1 | ||
pytest==2.7.2 | ||
pytest==2.9.1 | ||
coverage==3.7.1 | ||
pytest-cov==2.1.0 | ||
flake8==2.4.1 | ||
flake8==2.4.1 |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -299,56 +299,30 @@ def test_convert_volume_binds_no_mode(self): | |
self.assertEqual(convert_volume_binds(data), ['/mnt/vol1:/data:rw']) | ||
|
||
def test_convert_volume_binds_unicode_bytes_input(self): | ||
if six.PY2: | ||
expected = [unicode('/mnt/지연:/unicode/박:rw', 'utf-8')] | ||
|
||
data = { | ||
'/mnt/지연': { | ||
'bind': '/unicode/박', | ||
'mode': 'rw' | ||
} | ||
} | ||
self.assertEqual( | ||
convert_volume_binds(data), expected | ||
) | ||
else: | ||
expected = ['/mnt/지연:/unicode/박:rw'] | ||
expected = [u'/mnt/지연:/unicode/박:rw'] | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don't think we want to remove the tests for PY2. Having them in separate test cases with There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. They're still there. I just combined the 3K and 2 tests There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Oh, I missed that, sounds good. |
||
|
||
data = { | ||
bytes('/mnt/지연', 'utf-8'): { | ||
'bind': bytes('/unicode/박', 'utf-8'), | ||
'mode': 'rw' | ||
} | ||
data = { | ||
u'/mnt/지연'.encode('utf-8'): { | ||
'bind': u'/unicode/박'.encode('utf-8'), | ||
'mode': 'rw' | ||
} | ||
self.assertEqual( | ||
convert_volume_binds(data), expected | ||
) | ||
} | ||
self.assertEqual( | ||
convert_volume_binds(data), expected | ||
) | ||
|
||
def test_convert_volume_binds_unicode_unicode_input(self): | ||
if six.PY2: | ||
expected = [unicode('/mnt/지연:/unicode/박:rw', 'utf-8')] | ||
|
||
data = { | ||
unicode('/mnt/지연', 'utf-8'): { | ||
'bind': unicode('/unicode/박', 'utf-8'), | ||
'mode': 'rw' | ||
} | ||
} | ||
self.assertEqual( | ||
convert_volume_binds(data), expected | ||
) | ||
else: | ||
expected = ['/mnt/지연:/unicode/박:rw'] | ||
expected = [u'/mnt/지연:/unicode/박:rw'] | ||
|
||
data = { | ||
'/mnt/지연': { | ||
'bind': '/unicode/박', | ||
'mode': 'rw' | ||
} | ||
data = { | ||
u'/mnt/지연': { | ||
'bind': u'/unicode/박', | ||
'mode': 'rw' | ||
} | ||
self.assertEqual( | ||
convert_volume_binds(data), expected | ||
) | ||
} | ||
self.assertEqual( | ||
convert_volume_binds(data), expected | ||
) | ||
|
||
|
||
class ParseEnvFileTest(base.BaseTestCase): | ||
|
@@ -612,13 +586,7 @@ def test_create_ipam_config(self): | |
class SplitCommandTest(base.BaseTestCase): | ||
|
||
def test_split_command_with_unicode(self): | ||
if six.PY2: | ||
self.assertEqual( | ||
split_command(unicode('echo μμ', 'utf-8')), | ||
['echo', 'μμ'] | ||
) | ||
else: | ||
self.assertEqual(split_command('echo μμ'), ['echo', 'μμ']) | ||
self.assertEqual(split_command(u'echo μμ'), ['echo', 'μμ']) | ||
|
||
@pytest.mark.skipif(six.PY3, reason="shlex doesn't support bytes in py3") | ||
def test_split_command_with_bytes(self): | ||
|
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
all this does is allow users to enter their storage size in pounds (300lb) on python 2