@@ -100,7 +100,9 @@ def test_build_with_dockerignore(self):
100
100
'ignored' ,
101
101
'Dockerfile' ,
102
102
'.dockerignore' ,
103
+ ' ignored-with-spaces ' , # check that spaces are trimmed
103
104
'!ignored/subdir/excepted-file' ,
105
+ '! ignored/subdir/excepted-with-spaces '
104
106
'' , # empty line,
105
107
'#*' , # comment line
106
108
]))
@@ -111,6 +113,9 @@ def test_build_with_dockerignore(self):
111
113
with open (os .path .join (base_dir , '#file.txt' ), 'w' ) as f :
112
114
f .write ('this file should not be ignored' )
113
115
116
+ with open (os .path .join (base_dir , 'ignored-with-spaces' ), 'w' ) as f :
117
+ f .write ("this file should be ignored" )
118
+
114
119
subdir = os .path .join (base_dir , 'ignored' , 'subdir' )
115
120
os .makedirs (subdir )
116
121
with open (os .path .join (subdir , 'file' ), 'w' ) as f :
@@ -119,6 +124,9 @@ def test_build_with_dockerignore(self):
119
124
with open (os .path .join (subdir , 'excepted-file' ), 'w' ) as f :
120
125
f .write ("this file should not be ignored" )
121
126
127
+ with open (os .path .join (subdir , 'excepted-with-spaces' ), 'w' ) as f :
128
+ f .write ("this file should not be ignored" )
129
+
122
130
tag = 'docker-py-test-build-with-dockerignore'
123
131
stream = self .client .build (
124
132
path = base_dir ,
@@ -136,6 +144,7 @@ def test_build_with_dockerignore(self):
136
144
137
145
assert sorted (list (filter (None , logs .split ('\n ' )))) == sorted ([
138
146
'/test/#file.txt' ,
147
+ '/test/ignored/subdir/excepted-with-spaces' ,
139
148
'/test/ignored/subdir/excepted-file' ,
140
149
'/test/not-ignored'
141
150
])
0 commit comments