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
3244094d
Unverified
Kaydet (Commit)
3244094d
authored
Mar 27, 2019
tarafından
Ulysses Souza
Kaydeden (comit)
GitHub
Mar 27, 2019
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Sade Fark
Merge pull request #2292 from ulyssessouza/fix-config-proxy-mapping
Fix base_url to keep TCP protocol
üst
02e660da
b2175c94
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
12 additions
and
8 deletions
+12
-8
utils.py
docker/utils/utils.py
+1
-3
api_container_test.py
tests/integration/api_container_test.py
+3
-1
utils_test.py
tests/unit/utils_test.py
+8
-4
No files found.
docker/utils/utils.py
Dosyayı görüntüle @
3244094d
...
@@ -352,9 +352,7 @@ def kwargs_from_env(ssl_version=None, assert_hostname=None, environment=None):
...
@@ -352,9 +352,7 @@ def kwargs_from_env(ssl_version=None, assert_hostname=None, environment=None):
params
=
{}
params
=
{}
if
host
:
if
host
:
params
[
'base_url'
]
=
(
params
[
'base_url'
]
=
host
host
.
replace
(
'tcp://'
,
'https://'
)
if
enable_tls
else
host
)
if
not
enable_tls
:
if
not
enable_tls
:
return
params
return
params
...
...
tests/integration/api_container_test.py
Dosyayı görüntüle @
3244094d
...
@@ -1080,7 +1080,6 @@ class KillTest(BaseAPIIntegrationTest):
...
@@ -1080,7 +1080,6 @@ class KillTest(BaseAPIIntegrationTest):
class
PortTest
(
BaseAPIIntegrationTest
):
class
PortTest
(
BaseAPIIntegrationTest
):
def
test_port
(
self
):
def
test_port
(
self
):
port_bindings
=
{
port_bindings
=
{
'1111'
:
(
'127.0.0.1'
,
'4567'
),
'1111'
:
(
'127.0.0.1'
,
'4567'
),
'2222'
:
(
'127.0.0.1'
,
'4568'
),
'2222'
:
(
'127.0.0.1'
,
'4568'
),
...
@@ -1268,6 +1267,9 @@ class AttachContainerTest(BaseAPIIntegrationTest):
...
@@ -1268,6 +1267,9 @@ class AttachContainerTest(BaseAPIIntegrationTest):
@pytest.mark.timeout
(
5
)
@pytest.mark.timeout
(
5
)
@pytest.mark.skipif
(
os
.
environ
.
get
(
'DOCKER_HOST'
,
''
)
.
startswith
(
'ssh://'
),
@pytest.mark.skipif
(
os
.
environ
.
get
(
'DOCKER_HOST'
,
''
)
.
startswith
(
'ssh://'
),
reason
=
'No cancellable streams over SSH'
)
reason
=
'No cancellable streams over SSH'
)
@pytest.mark.xfail
(
condition
=
os
.
environ
.
get
(
'DOCKER_TLS_VERIFY'
)
or
os
.
environ
.
get
(
'DOCKER_CERT_PATH'
),
reason
=
'Flaky test on TLS'
)
def
test_attach_stream_and_cancel
(
self
):
def
test_attach_stream_and_cancel
(
self
):
container
=
self
.
client
.
create_container
(
container
=
self
.
client
.
create_container
(
BUSYBOX
,
'sh -c "echo hello && sleep 60"'
,
BUSYBOX
,
'sh -c "echo hello && sleep 60"'
,
...
...
tests/unit/utils_test.py
Dosyayı görüntüle @
3244094d
...
@@ -11,6 +11,7 @@ import unittest
...
@@ -11,6 +11,7 @@ import unittest
from
docker.api.client
import
APIClient
from
docker.api.client
import
APIClient
from
docker.constants
import
IS_WINDOWS_PLATFORM
from
docker.errors
import
DockerException
from
docker.errors
import
DockerException
from
docker.utils
import
(
from
docker.utils
import
(
convert_filters
,
convert_volume_binds
,
decode_json_header
,
kwargs_from_env
,
convert_filters
,
convert_volume_binds
,
decode_json_header
,
kwargs_from_env
,
...
@@ -83,15 +84,17 @@ class KwargsFromEnvTest(unittest.TestCase):
...
@@ -83,15 +84,17 @@ class KwargsFromEnvTest(unittest.TestCase):
DOCKER_CERT_PATH
=
TEST_CERT_DIR
,
DOCKER_CERT_PATH
=
TEST_CERT_DIR
,
DOCKER_TLS_VERIFY
=
'1'
)
DOCKER_TLS_VERIFY
=
'1'
)
kwargs
=
kwargs_from_env
(
assert_hostname
=
False
)
kwargs
=
kwargs_from_env
(
assert_hostname
=
False
)
assert
'
https
://192.168.59.103:2376'
==
kwargs
[
'base_url'
]
assert
'
tcp
://192.168.59.103:2376'
==
kwargs
[
'base_url'
]
assert
'ca.pem'
in
kwargs
[
'tls'
]
.
ca_cert
assert
'ca.pem'
in
kwargs
[
'tls'
]
.
ca_cert
assert
'cert.pem'
in
kwargs
[
'tls'
]
.
cert
[
0
]
assert
'cert.pem'
in
kwargs
[
'tls'
]
.
cert
[
0
]
assert
'key.pem'
in
kwargs
[
'tls'
]
.
cert
[
1
]
assert
'key.pem'
in
kwargs
[
'tls'
]
.
cert
[
1
]
assert
kwargs
[
'tls'
]
.
assert_hostname
is
False
assert
kwargs
[
'tls'
]
.
assert_hostname
is
False
assert
kwargs
[
'tls'
]
.
verify
assert
kwargs
[
'tls'
]
.
verify
parsed_host
=
parse_host
(
kwargs
[
'base_url'
],
IS_WINDOWS_PLATFORM
,
True
)
try
:
try
:
client
=
APIClient
(
**
kwargs
)
client
=
APIClient
(
**
kwargs
)
assert
kwargs
[
'base_url'
]
==
client
.
base_url
assert
parsed_host
==
client
.
base_url
assert
kwargs
[
'tls'
]
.
ca_cert
==
client
.
verify
assert
kwargs
[
'tls'
]
.
ca_cert
==
client
.
verify
assert
kwargs
[
'tls'
]
.
cert
==
client
.
cert
assert
kwargs
[
'tls'
]
.
cert
==
client
.
cert
except
TypeError
as
e
:
except
TypeError
as
e
:
...
@@ -102,15 +105,16 @@ class KwargsFromEnvTest(unittest.TestCase):
...
@@ -102,15 +105,16 @@ class KwargsFromEnvTest(unittest.TestCase):
DOCKER_CERT_PATH
=
TEST_CERT_DIR
,
DOCKER_CERT_PATH
=
TEST_CERT_DIR
,
DOCKER_TLS_VERIFY
=
''
)
DOCKER_TLS_VERIFY
=
''
)
kwargs
=
kwargs_from_env
(
assert_hostname
=
True
)
kwargs
=
kwargs_from_env
(
assert_hostname
=
True
)
assert
'
https
://192.168.59.103:2376'
==
kwargs
[
'base_url'
]
assert
'
tcp
://192.168.59.103:2376'
==
kwargs
[
'base_url'
]
assert
'ca.pem'
in
kwargs
[
'tls'
]
.
ca_cert
assert
'ca.pem'
in
kwargs
[
'tls'
]
.
ca_cert
assert
'cert.pem'
in
kwargs
[
'tls'
]
.
cert
[
0
]
assert
'cert.pem'
in
kwargs
[
'tls'
]
.
cert
[
0
]
assert
'key.pem'
in
kwargs
[
'tls'
]
.
cert
[
1
]
assert
'key.pem'
in
kwargs
[
'tls'
]
.
cert
[
1
]
assert
kwargs
[
'tls'
]
.
assert_hostname
is
True
assert
kwargs
[
'tls'
]
.
assert_hostname
is
True
assert
kwargs
[
'tls'
]
.
verify
is
False
assert
kwargs
[
'tls'
]
.
verify
is
False
parsed_host
=
parse_host
(
kwargs
[
'base_url'
],
IS_WINDOWS_PLATFORM
,
True
)
try
:
try
:
client
=
APIClient
(
**
kwargs
)
client
=
APIClient
(
**
kwargs
)
assert
kwargs
[
'base_url'
]
==
client
.
base_url
assert
parsed_host
==
client
.
base_url
assert
kwargs
[
'tls'
]
.
cert
==
client
.
cert
assert
kwargs
[
'tls'
]
.
cert
==
client
.
cert
assert
not
kwargs
[
'tls'
]
.
verify
assert
not
kwargs
[
'tls'
]
.
verify
except
TypeError
as
e
:
except
TypeError
as
e
:
...
...
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