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
ad4f5f9d
Kaydet (Commit)
ad4f5f9d
authored
Kas 22, 2018
tarafından
Corentin Henry
Kaydeden (comit)
Joffrey F
Kas 28, 2018
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
tests: fix failure due to pytest deprecation
Signed-off-by:
Corentin Henry
<
corentinhenry@gmail.com
>
üst
cafb802c
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
12 deletions
+12
-12
utils_config_test.py
tests/unit/utils_config_test.py
+12
-12
No files found.
tests/unit/utils_config_test.py
Dosyayı görüntüle @
ad4f5f9d
...
...
@@ -4,8 +4,8 @@ import shutil
import
tempfile
import
json
from
py
.test
import
ensuretemp
from
pytest
import
mark
from
py
test
import
mark
,
fixture
from
docker.utils
import
config
try
:
...
...
@@ -15,25 +15,25 @@ except ImportError:
class
FindConfigFileTest
(
unittest
.
TestCase
):
def
tmpdir
(
self
,
name
):
tmpdir
=
ensuretemp
(
nam
e
)
self
.
addCleanup
(
tmpdir
.
remove
)
return
tmp
dir
@fixture
(
autouse
=
Tru
e
)
def
tmpdir
(
self
,
tmpdir
):
self
.
mkdir
=
tmpdir
.
mk
dir
def
test_find_config_fallback
(
self
):
tmpdir
=
self
.
tmp
dir
(
'test_find_config_fallback'
)
tmpdir
=
self
.
mk
dir
(
'test_find_config_fallback'
)
with
mock
.
patch
.
dict
(
os
.
environ
,
{
'HOME'
:
str
(
tmpdir
)}):
assert
config
.
find_config_file
()
is
None
def
test_find_config_from_explicit_path
(
self
):
tmpdir
=
self
.
tmp
dir
(
'test_find_config_from_explicit_path'
)
tmpdir
=
self
.
mk
dir
(
'test_find_config_from_explicit_path'
)
config_path
=
tmpdir
.
ensure
(
'my-config-file.json'
)
assert
config
.
find_config_file
(
str
(
config_path
))
==
str
(
config_path
)
def
test_find_config_from_environment
(
self
):
tmpdir
=
self
.
tmp
dir
(
'test_find_config_from_environment'
)
tmpdir
=
self
.
mk
dir
(
'test_find_config_from_environment'
)
config_path
=
tmpdir
.
ensure
(
'config.json'
)
with
mock
.
patch
.
dict
(
os
.
environ
,
{
'DOCKER_CONFIG'
:
str
(
tmpdir
)}):
...
...
@@ -41,7 +41,7 @@ class FindConfigFileTest(unittest.TestCase):
@mark.skipif
(
"sys.platform == 'win32'"
)
def
test_find_config_from_home_posix
(
self
):
tmpdir
=
self
.
tmp
dir
(
'test_find_config_from_home_posix'
)
tmpdir
=
self
.
mk
dir
(
'test_find_config_from_home_posix'
)
config_path
=
tmpdir
.
ensure
(
'.docker'
,
'config.json'
)
with
mock
.
patch
.
dict
(
os
.
environ
,
{
'HOME'
:
str
(
tmpdir
)}):
...
...
@@ -49,7 +49,7 @@ class FindConfigFileTest(unittest.TestCase):
@mark.skipif
(
"sys.platform == 'win32'"
)
def
test_find_config_from_home_legacy_name
(
self
):
tmpdir
=
self
.
tmp
dir
(
'test_find_config_from_home_legacy_name'
)
tmpdir
=
self
.
mk
dir
(
'test_find_config_from_home_legacy_name'
)
config_path
=
tmpdir
.
ensure
(
'.dockercfg'
)
with
mock
.
patch
.
dict
(
os
.
environ
,
{
'HOME'
:
str
(
tmpdir
)}):
...
...
@@ -57,7 +57,7 @@ class FindConfigFileTest(unittest.TestCase):
@mark.skipif
(
"sys.platform != 'win32'"
)
def
test_find_config_from_home_windows
(
self
):
tmpdir
=
self
.
tmp
dir
(
'test_find_config_from_home_windows'
)
tmpdir
=
self
.
mk
dir
(
'test_find_config_from_home_windows'
)
config_path
=
tmpdir
.
ensure
(
'.docker'
,
'config.json'
)
with
mock
.
patch
.
dict
(
os
.
environ
,
{
'USERPROFILE'
:
str
(
tmpdir
)}):
...
...
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