summaryrefslogtreecommitdiff
path: root/tests/unit/utils_test.py
Commit message (Collapse)AuthorAgeFilesLines
* Rewrite utils.parse_host to detect more invalid addresses.ssh_protocol_supportJoffrey F2018-11-011-2/+10
| | | | | | | | The method now uses parsing methods from urllib to better split provided URLs. Addresses containing query strings, parameters, passwords or fragments no longer fail silently. SSH addresses containing paths are no longer accepted. Signed-off-by: Joffrey F <joffrey@docker.com>
* On Windows, convert paths to use forward slashes before fnmatch callJoffrey F2018-06-281-485/+5
| | | | Signed-off-by: Joffrey F <joffrey@docker.com>
* Improved .dockerignore pattern processing to better match Docker CLI behaviorJoffrey F2018-06-281-1/+11
| | | | Signed-off-by: Joffrey F <joffrey@docker.com>
* Don't descend into symlinks when building context tarJoffrey F2018-03-211-0/+15
| | | | Signed-off-by: Joffrey F <joffrey@docker.com>
* Use same split rules for Dockerfile as other include/exclude patternsJoffrey F2018-03-201-0/+5
| | | | Signed-off-by: Joffrey F <joffrey@docker.com>
* Add test for "/.." patterns in .dockerignore.mefyl2018-02-261-0/+16
| | | | Signed-off-by: mefyl <quentin.hocquet@docker.com>
* Fix .dockerignore: accept wildcard in inclusion pattern, honor last line ↵mefyl2018-02-211-64/+20
| | | | | | precedence. Signed-off-by: mefyl <quentin.hocquet@docker.com>
* Fix dockerignore handling of absolute path exceptions.mefyl2018-02-211-0/+7
| | | | Signed-off-by: mefyl <quentin.hocquet@docker.com>
* Revert "Correctly support absolute paths in .dockerignore"mefyl2018-02-191-17/+10
| | | | | | This reverts commit 34d50483e20e86cb7ab22700e036a5c4d319268a. Signed-off-by: mefyl <quentin.hocquet@docker.com>
* Correctly support absolute paths in .dockerignorec5672-dockerignore-abspathJoffrey F2018-02-121-10/+17
| | | | Signed-off-by: Joffrey F <joffrey@docker.com>
* Merge pull request #1901 from docker/1899-create_archive_fixJoffrey F2018-02-051-2/+6
|\ | | | | Rewrite access check in create_archive with EAFP
| * Rewrite access check in create_archive with EAFP1899-create_archive_fixJoffrey F2018-02-051-2/+6
| | | | | | | | Signed-off-by: Joffrey F <joffrey@docker.com>
* | Add workaround for bpo-32713c5618-negative-mtime-tarJoffrey F2018-02-011-0/+12
|/ | | | Signed-off-by: Joffrey F <joffrey@docker.com>
* Improve separation between auth_configs and general_configsimprove_authconfig_genconfig_separationJoffrey F2018-01-301-2/+2
| | | | Signed-off-by: Joffrey F <joffrey@docker.com>
* Merge pull request #1881 from docker/pytest-assertsJoffrey F2018-01-301-162/+141
|\ | | | | Use pytest asserts
| * Use pytest assertspytest-assertsJoffrey F2018-01-301-162/+141
| | | | | | | | Signed-off-by: Joffrey F <joffrey@docker.com>
* | Do not break when archiving broken symlinks1841-tar-broken-symlinksJoffrey F2018-01-291-0/+26
|/ | | | Signed-off-by: Joffrey F <joffrey@docker.com>
* Commit d798afca made changes for the handling of '**' patterns inVeli-Matti Lintu2017-08-221-0/+17
| | | | | | | | .dockerignore. This causes an IndexError with patterns ending with '**', e.g. 'subdir/**'. This adds a missing boundary check before checking for trailing '/'. Signed-off-by: Veli-Matti Lintu <veli-matti.lintu@nosto.com>
* Leading slash in .dockerignore should be ignoredJoffrey F2017-08-171-0/+5
| | | | Signed-off-by: Joffrey F <joffrey@docker.com>
* Generating regexp from .dockerignore file in a similar way as docker-ce.Jakub Goszczurny2017-08-171-0/+25
| | | | Signed-off-by: Jakub Goszczurny <szczurmys@o2.pl>
* split_port should not break when passed a non-string argumentJoffrey F2017-06-281-0/+3
| | | | Signed-off-by: Joffrey F <joffrey@docker.com>
* Add a specific unit test for splitting port with IPv6kaiyou2017-06-051-0/+6
| | | | | | The test was copied from https://github.com/greybyte/docker-py/commit/ccec87ca2c2aacfcfe3b38c5bc7d59dd73551c51 Signed-off-by: kaiyou <pierre@jaury.eu>
* Fix test issuesappveyorJoffrey F2017-03-291-43/+37
| | | | Signed-off-by: Joffrey F <joffrey@docker.com>
* Raise an error when passing an empty string to split_portJoffrey F2017-03-091-0/+3
| | | | Signed-off-by: Joffrey F <joffrey@docker.com>
* fix: Missing exception handling in split_port when no container portLei Gong2017-03-091-0/+4
| | | | | | | | | | "localhost:host_port:" case will raise TypeError exception directly Catch the "TypeError" and give proper error message * docker/utils/ports.py Signed-off-by: Lei Gong <xue177125184@gmail.com>
* Allow port range like 8000-8010:80crierr2017-02-201-0/+5
| | | | Signed-off-by: SeungJin Oh <crierr@naver.com>
* Add support for recursive wildcard pattern in .dockerignoreJoffrey F2017-02-141-3/+13
| | | | Signed-off-by: Joffrey F <joffrey@docker.com>
* Ignore socket files in utils.tarJoffrey F2017-01-241-0/+15
| | | | Signed-off-by: Joffrey F <joffrey@docker.com>
* Accept / as a path separator in dockerignore patterns on all platformscompose-4302-dockerignore-windowsJoffrey F2017-01-061-0/+18
| | | | Signed-off-by: Joffrey F <joffrey@docker.com>
* Move config type creation from docker.utils functions to classes inconfig_typesJoffrey F2016-12-011-243/+5
| | | | | | docker.types Signed-off-by: Joffrey F <joffrey@docker.com>
* Merge pull request #1277 from ↵Ben Firshman2016-11-291-1/+75
|\ | | | | | | | | bodnarbm/do-not-traverse-ignored-directories-with-no-potential-exceptions Do not traverse excluded directories that are not prefixes of dockerignore exceptions.
| * Add unit tests for should_check_directory.Brandon Bodnar2016-11-261-1/+75
| | | | | | | | Signed-off-by: Brandon Bodnar <bodnarbm@gmail.com>
* | Merge pull request #1297 from docker/stepanstipl-allow_custom_pid_modeJoffrey F2016-11-281-0/+13
|\ \ | | | | | | Allow custom pid mode
| * | Re-enable pid_mode checks for API < 1.24stepanstipl-allow_custom_pid_modeJoffrey F2016-11-281-0/+13
| |/ | | | | | | Signed-off-by: Joffrey F <joffrey@docker.com>
* | Fix parsing for an environment file with newlinesJon Cotton2016-11-281-1/+9
|/ | | | | | Fixes the new, purposely broken test added in the previous commit. Signed-off-by: Jon Cotton <jc@finaltransfer.net>
* Rename Client to APIClientBen Firshman2016-11-221-8/+7
| | | | Signed-off-by: Ben Firshman <ben@firshman.co.uk>
* Drop support for Python 2.6Ben Firshman2016-11-221-18/+17
| | | | | | | Because it's ancient. If you're still using it, you can use an old version of docker-py. Signed-off-by: Ben Firshman <ben@firshman.co.uk>
* Merge pull request #1236 from docker/host_config_isolationJoffrey F2016-11-171-1/+12
|\ | | | | Add support for isolation param in host config
| * Add support for isolation param in host confighost_config_isolationJoffrey F2016-09-291-1/+12
| | | | | | | | Signed-off-by: Joffrey F <joffrey@docker.com>
* | Update tests to avoid failures on Windows platformsJoffrey F2016-10-141-53/+87
| | | | | | | | Signed-off-by: Joffrey F <joffrey@docker.com>
* | Merge pull request #1256 from docker/format_env_unicode_bugJoffrey F2016-10-131-2/+17
|\ \ | | | | | | Do not break when calling format_environment with unicode values
| * | Do not break when calling format_environment with unicode valuesformat_env_unicode_bugJoffrey F2016-10-121-2/+17
| |/ | | | | | | Signed-off-by: Joffrey F <joffrey@docker.com>
* | Remove trailing slashes in result of utils.parse_hostbase_url_trailing_slashJoffrey F2016-10-121-0/+5
|/ | | | Signed-off-by: Joffrey F <joffrey@docker.com>
* Docs and tests for pids_limit.aiden0z-masterJoffrey F2016-08-231-0/+9
| | | | Signed-off-by: Joffrey F <joffrey@docker.com>
* support MemoryReservation and KernelMemoryKay Yan2016-08-231-0/+14
| | | | Signed-off-by: Kay Yan <kay.yan@daocloud.io>
* Merge branch 'master' of https://github.com/srikalyan/docker-py into ↵Joffrey F2016-08-231-1/+10
|\ | | | | | | srikalyan-master
| * Added support for user namespace.Srikalyan Swayampakula2016-06-301-1/+10
| | | | | | | | Signed-off-by: Srikalyan Swayampakula <srikalyansswayam@gmail.com>
* | Implemented dns_opt support (from api 1.21)George Lester2016-08-071-0/+13
| | | | | | | | Signed-off-by: George Lester <glester491@gmail.com>
* | Avoid crashing in update_headers decorator when headers kwarg is None1148-update-headers-fixJoffrey F2016-08-021-1/+34
| | | | | | | | Signed-off-by: Joffrey F <joffrey@docker.com>
* | Add support for IPv6 docker host connections.1135-ipv6-docker-hostJoffrey F2016-07-271-1/+9
| | | | | | | | Signed-off-by: Joffrey F <joffrey@docker.com>