diff options
author | Joffrey F <f.joffrey@gmail.com> | 2018-02-26 10:53:41 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-02-26 10:53:41 -0800 |
commit | fe966764ef597c5260e25d1806a0077883740fd1 (patch) | |
tree | 281ff94675da71fedef99907a50ba3735bb032fc | |
parent | 8b246db271a85d6541dc458838627e89c683e42f (diff) | |
parent | 429591910359dd7487dc111298eaf1f36121631d (diff) | |
download | docker-py-fe966764ef597c5260e25d1806a0077883740fd1.tar.gz |
Merge pull request #1927 from mefyl/master
Add test for "/.." patterns in .dockerignore.
-rw-r--r-- | tests/unit/utils_test.py | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/tests/unit/utils_test.py b/tests/unit/utils_test.py index 8a4b193..c2dd502 100644 --- a/tests/unit/utils_test.py +++ b/tests/unit/utils_test.py @@ -902,6 +902,22 @@ class ExcludePathsTest(unittest.TestCase): ['*.md', '!README*.md', 'README-secret.md'] ) == set(['README.md', 'README-bis.md']) + def test_parent_directory(self): + base = make_tree( + [], + ['a.py', + 'b.py', + 'c.py']) + # Dockerignore reference stipulates that absolute paths are + # equivalent to relative paths, hence /../foo should be + # equivalent to ../foo. It also stipulates that paths are run + # through Go's filepath.Clean, which explicitely "replace + # "/.." by "/" at the beginning of a path". + assert exclude_paths( + base, + ['../a.py', '/../b.py'] + ) == set(['c.py']) + class TarTest(unittest.TestCase): def test_tar_with_excludes(self): |