Kaydet (Commit) 13609359 authored tarafından Joffrey F's avatar Joffrey F

Improve dockerignore comment test

Signed-off-by: 's avatarJoffrey F <joffrey@docker.com>
üst 74586cdd
...@@ -62,12 +62,15 @@ class BuildTest(BaseAPIIntegrationTest): ...@@ -62,12 +62,15 @@ class BuildTest(BaseAPIIntegrationTest):
'.dockerignore', '.dockerignore',
'!ignored/subdir/excepted-file', '!ignored/subdir/excepted-file',
'', # empty line, '', # empty line,
'#', # comment line '#*', # comment line
])) ]))
with open(os.path.join(base_dir, 'not-ignored'), 'w') as f: with open(os.path.join(base_dir, 'not-ignored'), 'w') as f:
f.write("this file should not be ignored") f.write("this file should not be ignored")
with open(os.path.join(base_dir, '#file.txt'), 'w') as f:
f.write('this file should not be ignored')
subdir = os.path.join(base_dir, 'ignored', 'subdir') subdir = os.path.join(base_dir, 'ignored', 'subdir')
os.makedirs(subdir) os.makedirs(subdir)
with open(os.path.join(subdir, 'file'), 'w') as f: with open(os.path.join(subdir, 'file'), 'w') as f:
...@@ -93,6 +96,7 @@ class BuildTest(BaseAPIIntegrationTest): ...@@ -93,6 +96,7 @@ class BuildTest(BaseAPIIntegrationTest):
logs = logs.decode('utf-8') logs = logs.decode('utf-8')
assert sorted(list(filter(None, logs.split('\n')))) == sorted([ assert sorted(list(filter(None, logs.split('\n')))) == sorted([
'/test/#file.txt',
'/test/ignored/subdir/excepted-file', '/test/ignored/subdir/excepted-file',
'/test/not-ignored' '/test/not-ignored'
]) ])
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment