summaryrefslogtreecommitdiff
path: root/tests/unit
Commit message (Collapse)AuthorAgeFilesLines
* Do not interrupt streaming when encountering 0-length framesJoffrey F2017-08-311-1/+3
| | | | Signed-off-by: Joffrey F <joffrey@docker.com>
* Commit d798afca made changes for the handling of '**' patterns inVeli-Matti Lintu2017-08-211-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>
* Fix handling of non-multiplexed (TTY) streams over upgraded socketsJoffrey F2017-08-171-1/+1
| | | | Signed-off-by: Joffrey F <joffrey@docker.com>
* Allow detach and remove for api version >= 1.25 and use auto_remove when ↵David Steines2017-08-151-0/+30
| | | | | | both are set. Continue raising an exception for api versions <1.25. Signed-off-by: David Steines <d.steines@gmail.com>
* Leading slash in .dockerignore should be ignoredJoffrey F2017-08-151-0/+5
| | | | Signed-off-by: Joffrey F <joffrey@docker.com>
* Return generator for output of load_image endpointJoffrey F2017-08-151-0/+14
| | | | Signed-off-by: Joffrey F <joffrey@docker.com>
* client.containers.run returns None if none of json-file or journald logging ↵Artem Bolshakov2017-08-072-1/+39
| | | | | | drivers used Signed-off-by: Artem Bolshakov <either.free@gmail.com>
* Generating regexp from .dockerignore file in a similar way as docker-ce.Jakub Goszczurny2017-08-011-0/+25
| | | | Signed-off-by: Jakub Goszczurny <szczurmys@o2.pl>
* Fix #1673 check resource error in container network APIMatthew Berry2017-07-141-3/+3
| | | | | | | | Container network functions checked 'image' as resource ID and not 'container'. This caused a traceback when using container as named argument. Signed-off-by: Matthew Berry <mtberry89@gmail.com>
* split_port should not break when passed a non-string argumentJoffrey F2017-06-281-0/+3
| | | | Signed-off-by: Joffrey F <joffrey@docker.com>
* Support credHelpers section in config.json1633-credhelpers-supportJoffrey F2017-06-221-0/+51
| | | | Signed-off-by: Joffrey F <joffrey@docker.com>
* Merge pull request #1632 from kaiyou/masterJoffrey F2017-06-161-0/+6
|\ | | | | allow ipv6 :: notation in split_port (using re)
| * 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>
* | Raising error in case of invalid value of since kwarg on Container.logsChris Mark2017-06-161-0/+7
| | | | | | | | Signed-off-by: Chris Mark <chrismarkou92@gmail.com>
* | Ensure default timeout is used by API Clientgrahamlyons2017-06-081-0/+13
|/ | | | | | | | | | | The `from_env` method on the `docker` module passed `None` as the value for the `timeout` keyword argument which overrode the default value in the initialiser, taken from `constants` module. This sets the default in the initialiser to `None` and adds logic to set that, in the same way that `version` is handled. Signed-off-by: grahamlyons <graham@grahamlyons.com>
* Replace erroneous networks argument in containers.run with singular1433-run-networksJoffrey F2017-05-121-3/+2
| | | | | | | | network equivalent. Small docfixes Signed-off-by: Joffrey F <joffrey@docker.com>
* Include tag in images.get after pulling if provided separately1585-pull-tagJoffrey F2017-05-092-2/+2
| | | | Signed-off-by: Joffrey F <joffrey@docker.com>
* Add ContainerSpec mounts testJoffrey F2017-05-081-2/+18
| | | | Signed-off-by: Joffrey F <joffrey@docker.com>
* Merge branch 'add-env-support-to-exec' of ↵Joffrey F2017-05-021-1/+1
|\ | | | | | | | | | | https://github.com/TomasTomecek/docker-py into TomasTomecek-add-env-support-to-exec Signed-off-by: Joffrey F <joffrey@docker.com>
| * exec: add support for `Env`Tomas Tomecek2017-04-291-1/+1
| | | | | | | | Signed-off-by: Tomas Tomecek <ttomecek@redhat.com>
* | Fix typo s/CpuSetCpus/CpusetCpus/Dan Liew2017-05-012-2/+2
| | | | | | | | | | | | | | | | | | According to Docker's API documentation [1]. The parameter name is `CpusetCpus` not `CpuSetCpus`. [1] https://docs.docker.com/engine/api/v1.25/#operation/ContainerCreate Signed-off-by: Dan Liew <daniel.liew@imperial.ac.uk>
* | Add missing support for `CpusetMems` parameter to HostConfig.Dan Liew2017-05-011-0/+27
| | | | | | | | Signed-off-by: Dan Liew <daniel.liew@imperial.ac.uk>
* | Merge pull request #1570 from AlexeyRokhin/masterJoffrey F2017-04-282-0/+65
|\ \ | |/ |/| Add cpu_count, cpu_percent, nano_cpus parameters to container HostConfig.
| * cpus renamed to nano_cpus. Type and scale of nano_cpus are changed. Comments ↵Alexey Rokhin2017-04-282-10/+12
| | | | | | | | | | | | for new parameters are changed. Signed-off-by: Alexey Rokhin <arokhin@mail.ru>
| * Add cpu_count, cpu_percent, cpus parameters to container HostConfig.Alexey Rokhin2017-04-192-0/+63
| | | | | | | | Signed-off-by: Alexey Rokhin <arokhin@mail.ru>
* | Merge pull request #1493 from funkyfuture/model_propertiesJoffrey F2017-04-273-1/+17
|\ \ | | | | | | Adds a few model properties
| * | Adds an 'image' property to the container modelFrank Sachsenheim2017-04-151-0/+5
| | | | | | | | | | | | Signed-off-by: Frank Sachsenheim <funkyfuture@riseup.net>
| * | Adds a 'labels' property to the image modelFrank Sachsenheim2017-04-152-0/+6
| | | | | | | | | | | | Signed-off-by: Frank Sachsenheim <funkyfuture@riseup.net>
| * | Adds a 'labels' property to the container modelFrank Sachsenheim2017-04-152-1/+6
| |/ | | | | | | | | | | | | | | The Docker API seems to respond with a 'null' value for the 'Labels' attribute from containers that were created with older Docker versions. An empty dictionary is returned in this case. Signed-off-by: Frank Sachsenheim <funkyfuture@riseup.net>
* | Fix if replicas is set to 0, Fixes #1572Rob Kooper2017-04-261-0/+6
|/ | | | Signed-off-by: Rob Kooper <kooper@illinois.edu>
* Add support for volume_driver in HostConfigJoffrey F2017-04-052-9/+27
| | | | | | Some cleanup in ContainerConfig + warning if volume_driver is provided (API>1.20) Signed-off-by: Joffrey F <joffrey@docker.com>
* Fix test issuesappveyorJoffrey F2017-03-291-43/+37
| | | | Signed-off-by: Joffrey F <joffrey@docker.com>
* Set infinite timeout for the `events` methodJoffrey F2017-03-271-3/+3
| | | | Signed-off-by: Joffrey F <joffrey@docker.com>
* Fix APIError status_code property for client/server errorsalex-dr2017-03-221-0/+65
| | | | | | | | | | | | | requests.Response objects evaluate as falsy when the status_code attribute is in the 400-500 range. Therefore we are assured that prior to this change, APIError would show `is_server_error() == False` when generated with a 500-level response and `is_client_error() == False` when generated with a 400-level response. This is not desirable. Added some seemingly dry (not DRY) unit tests to ensure nothing silly slips back in here. Signed-off-by: alex-dr <alex@datarobot.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>
* Merge pull request #1467 from crierr/masterJoffrey F2017-02-221-0/+5
|\ | | | | Allow port range like 8000-8010:80
| * Allow port range like 8000-8010:80crierr2017-02-201-0/+5
| | | | | | | | Signed-off-by: SeungJin Oh <crierr@naver.com>
* | Merge pull request #1473 from Anvil/event-http-headersJoffrey F2017-02-211-3/+6
|\ \ | | | | | | Allow events daemon command to read config.json
| * | Fixed events command related unit tests by passing a timeout valueDamien Nadé2017-02-211-3/+6
| |/ | | | | | | Signed-off-by: Damien Nadé <github@livna.org>
* | Add ability to set 'Hostname' on a Service.Nils Krabshuis2017-02-191-2/+3
|/ | | | Signed-off-by: Nils Krabshuis <nils.krabshuis@redwood.com>
* Merge pull request #1449 from shin-/secrets-apiJoffrey F2017-02-152-4/+4
|\ | | | | Implement secrets API
| * Add tests for secret API implementationJoffrey F2017-02-132-4/+4
| | | | | | | | Signed-off-by: Joffrey F <joffrey@docker.com>
* | Add support for recursive wildcard pattern in .dockerignoreJoffrey F2017-02-141-3/+13
|/ | | | Signed-off-by: Joffrey F <joffrey@docker.com>
* Fix passing volumes to run with no host pathBen Firshman2017-02-071-1/+11
| | | | | | | | | Technically we shouldn't be passing them as binds, but the daemon doesn't seem to mind. Fixes #1380 Signed-off-by: Ben Firshman <ben@firshman.co.uk>
* Fix volume path passed by run to create_containerBen Firshman2017-02-071-1/+3
| | | | | | | | | | | | Seems like this is pretty much ignored by Docker, so it wasn't causing any visible issues, except when a volume name was used instead of a path. Also, added integration tests. Ref #1380 Signed-off-by: Ben Firshman <ben@firshman.co.uk>
* Merge pull request #1341 from pacoxu/patch-1Joffrey F2017-01-302-3/+16
|\ | | | | Scope is added in volume after docker 1.12
| * Scope is added in volume after docker 1.12徐俊杰2016-12-082-3/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Signed-off-by: pacoxu <paco.xu@daocloud.io> add ut test for volume scope and no specified name create Signed-off-by: Paco Xu <paco.xu@daocloud.io> try to fix ut failure of volume creation Signed-off-by: Paco Xu <paco.xu@daocloud.io> try to fix ut failure of volume creation Signed-off-by: Paco Xu <paco.xu@daocloud.io> Scope is added in volume after docker 1.12 Signed-off-by: pacoxu <paco.xu@daocloud.io> Scope is added in volume after docker 1.12 Signed-off-by: pacoxu <paco.xu@daocloud.io>
* | Ignore socket files in utils.tarJoffrey F2017-01-241-0/+15
| | | | | | | | Signed-off-by: Joffrey F <joffrey@docker.com>
* | Convert mode argument to valid structure in create_service1388-format-service-modeJoffrey F2017-01-191-2/+31
| | | | | | | | Signed-off-by: Joffrey F <joffrey@docker.com>