mirror of
				https://github.com/docker/compose.git
				synced 2025-10-31 11:14:02 +01:00 
			
		
		
		
	Added default env file test.
Signed-off-by: Joffrey F <joffrey@docker.com>
This commit is contained in:
		
							parent
							
								
									1801f83bb8
								
							
						
					
					
						commit
						d55fc85fea
					
				
							
								
								
									
										4
									
								
								tests/fixtures/default-env-file/.env
									
									
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										4
									
								
								tests/fixtures/default-env-file/.env
									
									
									
									
										vendored
									
									
										Normal file
									
								
							| @ -0,0 +1,4 @@ | |||||||
|  | IMAGE=alpine:latest | ||||||
|  | COMMAND=true | ||||||
|  | PORT1=5643 | ||||||
|  | PORT2=9999 | ||||||
							
								
								
									
										6
									
								
								tests/fixtures/default-env-file/docker-compose.yml
									
									
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										6
									
								
								tests/fixtures/default-env-file/docker-compose.yml
									
									
									
									
										vendored
									
									
										Normal file
									
								
							| @ -0,0 +1,6 @@ | |||||||
|  | web: | ||||||
|  |     image: ${IMAGE} | ||||||
|  |     command: ${COMMAND} | ||||||
|  |     ports: | ||||||
|  |         - $PORT1 | ||||||
|  |         - $PORT2 | ||||||
| @ -1582,6 +1582,19 @@ class PortsTest(unittest.TestCase): | |||||||
| 
 | 
 | ||||||
| 
 | 
 | ||||||
| class InterpolationTest(unittest.TestCase): | class InterpolationTest(unittest.TestCase): | ||||||
|  |     @mock.patch.dict(os.environ) | ||||||
|  |     def test_config_file_with_environment_file(self): | ||||||
|  |         service_dicts = config.load( | ||||||
|  |             config.find('tests/fixtures/default-env-file', None) | ||||||
|  |         ).services | ||||||
|  | 
 | ||||||
|  |         self.assertEqual(service_dicts[0], { | ||||||
|  |             'name': 'web', | ||||||
|  |             'image': 'alpine:latest', | ||||||
|  |             'ports': ['5643', '9999'], | ||||||
|  |             'command': 'true' | ||||||
|  |         }) | ||||||
|  | 
 | ||||||
|     @mock.patch.dict(os.environ) |     @mock.patch.dict(os.environ) | ||||||
|     def test_config_file_with_environment_variable(self): |     def test_config_file_with_environment_variable(self): | ||||||
|         os.environ.update( |         os.environ.update( | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user