Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
D
docker-py
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
Batuhan Osman TASKAYA
docker-py
Commits
a610a1be
Kaydet (Commit)
a610a1be
authored
Eki 27, 2015
tarafından
Joffrey F
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Fix py3.2 test failure and unicode behavior
Signed-off-by:
Joffrey F
<
joffrey@docker.com
>
üst
311ae711
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
6 deletions
+10
-6
utils.py
docker/utils/utils.py
+1
-1
utils_test.py
tests/unit/utils_test.py
+9
-5
No files found.
docker/utils/utils.py
Dosyayı görüntüle @
a610a1be
...
...
@@ -674,7 +674,7 @@ def parse_env_file(env_file):
def
split_command
(
command
):
if
six
.
PY2
:
if
six
.
PY2
and
not
isinstance
(
command
,
six
.
binary_type
)
:
command
=
command
.
encode
(
'utf-8'
)
return
shlex
.
split
(
command
)
...
...
tests/unit/utils_test.py
Dosyayı görüntüle @
a610a1be
...
...
@@ -392,14 +392,18 @@ class UtilsTest(base.BaseTestCase):
class
SplitCommandTest
(
base
.
BaseTestCase
):
@pytest.mark.skipif
(
six
.
PY2
,
reason
=
"shlex doesn't support unicode in py2"
)
def
test_split_command_with_unicode
(
self
):
self
.
assertEqual
(
split_command
(
'echo μ'
),
[
'echo'
,
'μ'
])
if
six
.
PY2
:
self
.
assertEqual
(
split_command
(
unicode
(
'echo μμ'
,
'utf-8'
)),
[
'echo'
,
'μμ'
]
)
else
:
self
.
assertEqual
(
split_command
(
'echo μμ'
),
[
'echo'
,
'μμ'
])
@pytest.mark.skipif
(
six
.
PY3
,
reason
=
"shlex doesn't support
unicode in py2
"
)
@pytest.mark.skipif
(
six
.
PY3
,
reason
=
"shlex doesn't support
bytes in py3
"
)
def
test_split_command_with_bytes
(
self
):
expected
=
[
'echo'
,
u'μ'
.
encode
(
'utf-8'
)]
self
.
assertEqual
(
split_command
(
u'echo μ'
),
expected
)
self
.
assertEqual
(
split_command
(
'echo μμ'
),
[
'echo'
,
'μμ'
])
class
PortsTest
(
base
.
BaseTestCase
):
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment