summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorJoffrey F <joffrey@docker.com>2015-11-18 14:35:54 -0800
committerJoffrey F <joffrey@docker.com>2015-11-18 14:35:54 -0800
commitdfcc1d87bf4e6fb060780f18b3458811331cceba (patch)
treea54f856932b8494acbd3bfac4d16a8c972cf6f02 /tests
parent9ed721957ad42680b69141f89024e19245f1305b (diff)
parent8924319631445d25b5de885ea46c651522249de0 (diff)
downloaddocker-py-dfcc1d87bf4e6fb060780f18b3458811331cceba.tar.gz
Merge branch 'oom-kill-disable-pr' of https://github.com/schu/docker-py into schu-oom-kill-disable-pr
Diffstat (limited to 'tests')
-rw-r--r--tests/unit/utils_test.py9
1 files changed, 8 insertions, 1 deletions
diff --git a/tests/unit/utils_test.py b/tests/unit/utils_test.py
index 93f95a1..3c9f6e2 100644
--- a/tests/unit/utils_test.py
+++ b/tests/unit/utils_test.py
@@ -13,7 +13,7 @@ import six
from docker.client import Client
from docker.constants import DEFAULT_DOCKER_API_VERSION
-from docker.errors import DockerException
+from docker.errors import DockerException, InvalidVersion
from docker.utils import (
parse_repository_tag, parse_host, convert_filters, kwargs_from_env,
create_host_config, Ulimit, LogConfig, parse_bytes, parse_env_file,
@@ -62,6 +62,13 @@ class HostConfigTest(base.BaseTestCase):
config = create_host_config(version='1.20', cpu_period=1999)
self.assertEqual(config.get('CpuPeriod'), 1999)
+ def test_create_host_config_with_oom_kill_disable(self):
+ config = create_host_config(version='1.20', oom_kill_disable=True)
+ self.assertEqual(config.get('OomKillDisable'), True)
+ self.assertRaises(
+ InvalidVersion, lambda: create_host_config(version='1.18.3',
+ oom_kill_disable=True))
+
class UlimitTest(base.BaseTestCase):
def test_create_host_config_dict_ulimit(self):