@@ -736,6 +736,7 @@ class ExcludePathsTest(base.BaseTestCase):
736736 'foo/b.py' ,
737737 'foo/bar/a.py' ,
738738 'bar/a.py' ,
739+ 'foo/Dockerfile3' ,
739740 ]
740741
741742 all_paths = set (dirs + files )
@@ -775,6 +776,14 @@ def test_exclude_custom_dockerfile(self):
775776 assert self .exclude (['*' ], dockerfile = 'Dockerfile.alt' ) == \
776777 set (['Dockerfile.alt' , '.dockerignore' ])
777778
779+ assert self .exclude (['*' ], dockerfile = 'foo/Dockerfile3' ) == \
780+ set (['foo/Dockerfile3' , '.dockerignore' ])
781+
782+ def test_exclude_dockerfile_child (self ):
783+ includes = self .exclude (['foo/' ], dockerfile = 'foo/Dockerfile3' )
784+ assert 'foo/Dockerfile3' in includes
785+ assert 'foo/a.py' not in includes
786+
778787 def test_single_filename (self ):
779788 assert self .exclude (['a.py' ]) == self .all_paths - set (['a.py' ])
780789
@@ -825,28 +834,31 @@ def test_wildcard_subdir_wildcard_filename(self):
825834 def test_directory (self ):
826835 assert self .exclude (['foo' ]) == self .all_paths - set ([
827836 'foo' , 'foo/a.py' , 'foo/b.py' ,
828- 'foo/bar' , 'foo/bar/a.py' ,
837+ 'foo/bar' , 'foo/bar/a.py' , 'foo/Dockerfile3'
829838 ])
830839
831840 def test_directory_with_trailing_slash (self ):
832841 assert self .exclude (['foo' ]) == self .all_paths - set ([
833842 'foo' , 'foo/a.py' , 'foo/b.py' ,
834- 'foo/bar' , 'foo/bar/a.py' ,
843+ 'foo/bar' , 'foo/bar/a.py' , 'foo/Dockerfile3'
835844 ])
836845
837846 def test_directory_with_single_exception (self ):
838847 assert self .exclude (['foo' , '!foo/bar/a.py' ]) == self .all_paths - set ([
839- 'foo/a.py' , 'foo/b.py' , 'foo' , 'foo/bar'
848+ 'foo/a.py' , 'foo/b.py' , 'foo' , 'foo/bar' ,
849+ 'foo/Dockerfile3'
840850 ])
841851
842852 def test_directory_with_subdir_exception (self ):
843853 assert self .exclude (['foo' , '!foo/bar' ]) == self .all_paths - set ([
844- 'foo/a.py' , 'foo/b.py' , 'foo'
854+ 'foo/a.py' , 'foo/b.py' , 'foo' ,
855+ 'foo/Dockerfile3'
845856 ])
846857
847858 def test_directory_with_wildcard_exception (self ):
848859 assert self .exclude (['foo' , '!foo/*.py' ]) == self .all_paths - set ([
849- 'foo/bar' , 'foo/bar/a.py' , 'foo'
860+ 'foo/bar' , 'foo/bar/a.py' , 'foo' ,
861+ 'foo/Dockerfile3'
850862 ])
851863
852864 def test_subdirectory (self ):
0 commit comments