mirror of https://github.com/docker/docker-py.git
Added unit tests for container limits in build
This commit is contained in:
parent
ae329cb3ac
commit
7958110fda
|
@ -2254,6 +2254,25 @@ class DockerClientTest(Cleanup, base.BaseTestCase):
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
self.fail('Command should not raise exception: {0}'.format(e))
|
self.fail('Command should not raise exception: {0}'.format(e))
|
||||||
|
|
||||||
|
def test_build_container_with_container_limits(self):
|
||||||
|
try:
|
||||||
|
self.client.build('.', container_limits={
|
||||||
|
'memory': 1024 * 1024,
|
||||||
|
'cpusetcpus': 1,
|
||||||
|
'cpushares': 1000,
|
||||||
|
'memswap': 1024 * 1024 * 8
|
||||||
|
})
|
||||||
|
except Exception as e:
|
||||||
|
self.fail('Command should not raise exception: {0}'.format(e))
|
||||||
|
|
||||||
|
def test_build_container_invalid_container_limits(self):
|
||||||
|
self.assertRaises(
|
||||||
|
docker.errors.DockerException,
|
||||||
|
lambda: self.client.build('.', container_limits={
|
||||||
|
'foo': 'bar'
|
||||||
|
})
|
||||||
|
)
|
||||||
|
|
||||||
#######################
|
#######################
|
||||||
# PY SPECIFIC TESTS #
|
# PY SPECIFIC TESTS #
|
||||||
#######################
|
#######################
|
||||||
|
|
Loading…
Reference in New Issue