File tree Expand file tree Collapse file tree 1 file changed +22
-0
lines changed Expand file tree Collapse file tree 1 file changed +22
-0
lines changed Original file line number Diff line number Diff line change @@ -1415,6 +1415,28 @@ def runTest(self):
1415
1415
self .assertEqual (cfg .get ('Auth' ), None )
1416
1416
1417
1417
1418
+ class TestAutoDetectVersion (unittest .TestCase ):
1419
+ def test_client_init (self ):
1420
+ client = docker .Client (version = 'auto' )
1421
+ client_version = client ._version
1422
+ api_version = client .version (api_version = False )['ApiVersion' ]
1423
+ self .assertEqual (client_version , api_version )
1424
+ api_version_2 = client .version ()['ApiVersion' ]
1425
+ self .assertEqual (client_version , api_version_2 )
1426
+ client .close ()
1427
+
1428
+ def test_auto_client (self ):
1429
+ client = docker .AutoVersionClient ()
1430
+ client_version = client ._version
1431
+ api_version = client .version (api_version = False )['ApiVersion' ]
1432
+ self .assertEqual (client_version , api_version )
1433
+ api_version_2 = client .version ()['ApiVersion' ]
1434
+ self .assertEqual (client_version , api_version_2 )
1435
+ client .close ()
1436
+ with self .assertRaises (docker .errors .DockerException ):
1437
+ docker .AutoVersionClient (version = '1.11' )
1438
+
1439
+
1418
1440
class TestConnectionTimeout (unittest .TestCase ):
1419
1441
def setUp (self ):
1420
1442
self .timeout = 0.5
You can’t perform that action at this time.
0 commit comments