File tree Expand file tree Collapse file tree 1 file changed +19
-0
lines changed Expand file tree Collapse file tree 1 file changed +19
-0
lines changed Original file line number Diff line number Diff line change @@ -2254,6 +2254,25 @@ def test_build_container_with_named_dockerfile(self):
2254
2254
except Exception as e :
2255
2255
self .fail ('Command should not raise exception: {0}' .format (e ))
2256
2256
2257
+ def test_build_container_with_container_limits (self ):
2258
+ try :
2259
+ self .client .build ('.' , container_limits = {
2260
+ 'memory' : 1024 * 1024 ,
2261
+ 'cpusetcpus' : 1 ,
2262
+ 'cpushares' : 1000 ,
2263
+ 'memswap' : 1024 * 1024 * 8
2264
+ })
2265
+ except Exception as e :
2266
+ self .fail ('Command should not raise exception: {0}' .format (e ))
2267
+
2268
+ def test_build_container_invalid_container_limits (self ):
2269
+ self .assertRaises (
2270
+ docker .errors .DockerException ,
2271
+ lambda : self .client .build ('.' , container_limits = {
2272
+ 'foo' : 'bar'
2273
+ })
2274
+ )
2275
+
2257
2276
#######################
2258
2277
# PY SPECIFIC TESTS #
2259
2278
#######################
You can’t perform that action at this time.
0 commit comments