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
9fc8b3a7
Kaydet (Commit)
9fc8b3a7
authored
Eki 31, 2016
tarafından
Brandon Bodnar
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Add unit tests for should_check_directory.
Signed-off-by:
Brandon Bodnar
<
bodnarbm@gmail.com
>
üst
e2eb4a31
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
75 additions
and
1 deletion
+75
-1
utils_test.py
tests/unit/utils_test.py
+75
-1
No files found.
tests/unit/utils_test.py
Dosyayı görüntüle @
9fc8b3a7
...
@@ -25,7 +25,9 @@ from docker.utils import (
...
@@ -25,7 +25,9 @@ from docker.utils import (
)
)
from
docker.utils.ports
import
build_port_bindings
,
split_port
from
docker.utils.ports
import
build_port_bindings
,
split_port
from
docker.utils.utils
import
create_endpoint_config
,
format_environment
from
docker.utils.utils
import
(
create_endpoint_config
,
format_environment
,
should_check_directory
)
from
..helpers
import
make_tree
from
..helpers
import
make_tree
...
@@ -1092,6 +1094,78 @@ class TarTest(unittest.TestCase):
...
@@ -1092,6 +1094,78 @@ class TarTest(unittest.TestCase):
)
)
class
ShouldCheckDirectoryTest
(
unittest
.
TestCase
):
exclude_patterns
=
[
'exclude_rather_large_directory'
,
'dir/with/subdir_excluded'
,
'dir/with/exceptions'
]
include_patterns
=
[
'dir/with/exceptions/like_this_one'
,
'dir/with/exceptions/in/descendents'
]
def
test_should_check_directory_not_excluded
(
self
):
self
.
assertTrue
(
should_check_directory
(
'not_excluded'
,
self
.
exclude_patterns
,
self
.
include_patterns
)
)
self
.
assertTrue
(
should_check_directory
(
'dir/with'
,
self
.
exclude_patterns
,
self
.
include_patterns
)
)
def
test_shoud_check_parent_directories_of_excluded
(
self
):
self
.
assertTrue
(
should_check_directory
(
'dir'
,
self
.
exclude_patterns
,
self
.
include_patterns
)
)
self
.
assertTrue
(
should_check_directory
(
'dir/with'
,
self
.
exclude_patterns
,
self
.
include_patterns
)
)
def
test_should_not_check_excluded_directories_with_no_exceptions
(
self
):
self
.
assertFalse
(
should_check_directory
(
'exclude_rather_large_directory'
,
self
.
exclude_patterns
,
self
.
include_patterns
)
)
self
.
assertFalse
(
should_check_directory
(
'dir/with/subdir_excluded'
,
self
.
exclude_patterns
,
self
.
include_patterns
)
)
def
test_should_check_excluded_directory_with_exceptions
(
self
):
self
.
assertTrue
(
should_check_directory
(
'dir/with/exceptions'
,
self
.
exclude_patterns
,
self
.
include_patterns
)
)
self
.
assertTrue
(
should_check_directory
(
'dir/with/exceptions/in'
,
self
.
exclude_patterns
,
self
.
include_patterns
)
)
def
test_should_not_check_siblings_of_exceptions
(
self
):
self
.
assertFalse
(
should_check_directory
(
'dir/with/exceptions/but_not_here'
,
self
.
exclude_patterns
,
self
.
include_patterns
)
)
def
test_should_check_subdirectories_of_exceptions
(
self
):
self
.
assertTrue
(
should_check_directory
(
'dir/with/exceptions/like_this_one/subdir'
,
self
.
exclude_patterns
,
self
.
include_patterns
)
)
class
FormatEnvironmentTest
(
unittest
.
TestCase
):
class
FormatEnvironmentTest
(
unittest
.
TestCase
):
def
test_format_env_binary_unicode_value
(
self
):
def
test_format_env_binary_unicode_value
(
self
):
env_dict
=
{
env_dict
=
{
...
...
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