Skip to content

Commit 1360935

Browse files
committed
Improve dockerignore comment test
Signed-off-by: Joffrey F <[email protected]>
1 parent 74586cd commit 1360935

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

tests/integration/api_build_test.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,12 +62,15 @@ def test_build_with_dockerignore(self):
6262
'.dockerignore',
6363
'!ignored/subdir/excepted-file',
6464
'', # empty line,
65-
'#', # comment line
65+
'#*', # comment line
6666
]))
6767

6868
with open(os.path.join(base_dir, 'not-ignored'), 'w') as f:
6969
f.write("this file should not be ignored")
7070

71+
with open(os.path.join(base_dir, '#file.txt'), 'w') as f:
72+
f.write('this file should not be ignored')
73+
7174
subdir = os.path.join(base_dir, 'ignored', 'subdir')
7275
os.makedirs(subdir)
7376
with open(os.path.join(subdir, 'file'), 'w') as f:
@@ -93,6 +96,7 @@ def test_build_with_dockerignore(self):
9396
logs = logs.decode('utf-8')
9497

9598
assert sorted(list(filter(None, logs.split('\n')))) == sorted([
99+
'/test/#file.txt',
96100
'/test/ignored/subdir/excepted-file',
97101
'/test/not-ignored'
98102
])

0 commit comments

Comments
 (0)