| 
									
										
										
										
											2024-04-19 19:00:37 +02:00
										 |  |  | import pytest | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2024-06-21 15:11:34 +02:00
										 |  |  | from _openmetadata_testutils.postgres.conftest import postgres_container | 
					
						
							| 
									
										
										
										
											2024-05-28 09:30:30 +02:00
										 |  |  | from metadata.generated.schema.api.services.createDatabaseService import ( | 
					
						
							|  |  |  |     CreateDatabaseServiceRequest, | 
					
						
							|  |  |  | ) | 
					
						
							|  |  |  | from metadata.generated.schema.entity.services.connections.database.common.basicAuth import ( | 
					
						
							|  |  |  |     BasicAuth, | 
					
						
							|  |  |  | ) | 
					
						
							|  |  |  | from metadata.generated.schema.entity.services.connections.database.postgresConnection import ( | 
					
						
							|  |  |  |     PostgresConnection, | 
					
						
							|  |  |  | ) | 
					
						
							|  |  |  | from metadata.generated.schema.entity.services.databaseService import ( | 
					
						
							|  |  |  |     DatabaseConnection, | 
					
						
							|  |  |  |     DatabaseServiceType, | 
					
						
							|  |  |  | ) | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | @pytest.fixture(scope="module") | 
					
						
							| 
									
										
										
										
											2024-07-17 08:11:34 +02:00
										 |  |  | def create_service_request(postgres_container, tmp_path_factory): | 
					
						
							|  |  |  |     return CreateDatabaseServiceRequest( | 
					
						
							|  |  |  |         name="docker_test_" + tmp_path_factory.mktemp("postgres").name, | 
					
						
							| 
									
										
										
										
											2024-05-28 09:30:30 +02:00
										 |  |  |         serviceType=DatabaseServiceType.Postgres, | 
					
						
							|  |  |  |         connection=DatabaseConnection( | 
					
						
							|  |  |  |             config=PostgresConnection( | 
					
						
							|  |  |  |                 username=postgres_container.username, | 
					
						
							|  |  |  |                 authType=BasicAuth(password=postgres_container.password), | 
					
						
							|  |  |  |                 hostPort="localhost:" | 
					
						
							| 
									
										
										
										
											2025-09-23 16:53:51 +02:00
										 |  |  |                 + str(postgres_container.get_exposed_port(postgres_container.port)), | 
					
						
							| 
									
										
										
										
											2024-05-28 09:30:30 +02:00
										 |  |  |                 database="dvdrental", | 
					
						
							|  |  |  |             ) | 
					
						
							|  |  |  |         ), | 
					
						
							|  |  |  |     ) |