mirror of https://github.com/docker/docker-py.git
				
				
				
			Add integration test for named container creation
Signed-off-by: Maxime Petazzoni <max@signalfuse.com>
This commit is contained in:
		
							parent
							
								
									f344d8e65f
								
							
						
					
					
						commit
						afb349d257
					
				|  | @ -30,7 +30,7 @@ class BaseTestCase(unittest.TestCase): | ||||||
|     tmp_containers = [] |     tmp_containers = [] | ||||||
| 
 | 
 | ||||||
|     def setUp(self): |     def setUp(self): | ||||||
|         self.client = docker.Client() |         self.client = docker.Client(version="1.6") | ||||||
|         self.client.pull('busybox') |         self.client.pull('busybox') | ||||||
|         self.tmp_imgs = [] |         self.tmp_imgs = [] | ||||||
|         self.tmp_containers = [] |         self.tmp_containers = [] | ||||||
|  | @ -168,6 +168,16 @@ class TestCreateContainerPrivileged(BaseTestCase): | ||||||
|         self.assertEqual(inspect['Config']['Privileged'], True) |         self.assertEqual(inspect['Config']['Privileged'], True) | ||||||
| 
 | 
 | ||||||
| 
 | 
 | ||||||
|  | class TestCreateContainerWithName(BaseTestCase): | ||||||
|  |     def runTest(self): | ||||||
|  |         res = self.client.create_container('busybox', 'true', name='foobar') | ||||||
|  |         self.assertIn('Id', res) | ||||||
|  |         self.tmp_containers.append(res['Id']) | ||||||
|  |         inspect = self.client.inspect_container(res['Id']) | ||||||
|  |         self.assertIn('Name', inspect) | ||||||
|  |         self.assertEqual('/foobar', inspect['Name']) | ||||||
|  | 
 | ||||||
|  | 
 | ||||||
| class TestStartContainer(BaseTestCase): | class TestStartContainer(BaseTestCase): | ||||||
|     def runTest(self): |     def runTest(self): | ||||||
|         res = self.client.create_container('busybox', 'true') |         res = self.client.create_container('busybox', 'true') | ||||||
|  |  | ||||||
		Loading…
	
		Reference in New Issue