def setUp(self) -> None:
        self.app = create_app(config_module_class='metadata_service.config.LocalConfig')
        self.app_context = self.app.app_context()
        self.app_context.push()

        with patch('metadata_service.proxy.atlas_proxy.Atlas'):
            # Importing here to make app context work before
            # importing `current_app` indirectly using the AtlasProxy
            from metadata_service.proxy.atlas_proxy import AtlasProxy
            self.proxy = AtlasProxy(host='DOES_NOT_MATTER', port=0000)
            self.proxy._driver = MagicMock()
Beispiel #2
0
    def setUp(self) -> None:
        self.app = create_app(config_module_class='metadata_service.config.LocalConfig')
        self.app.config['PROGRAMMATIC_DESCRIPTIONS_EXCLUDE_FILTERS'] = ['spark.*']
        self.app.config['WATERMARK_DATE_FORMATS'] = ''
        self.app_context = self.app.app_context()
        self.app_context.push()

        with patch('metadata_service.proxy.atlas_proxy.Atlas'):
            # Importing here to make app context work before
            # importing `current_app` indirectly using the AtlasProxy
            from metadata_service.proxy.atlas_proxy import AtlasProxy
            self.proxy = AtlasProxy(host='DOES_NOT_MATTER', port=0000)
            self.proxy._driver = MagicMock()
    def setUp(self):
        with patch('metadata_service.proxy.atlas_proxy.Atlas'):
            self.proxy = AtlasProxy(host='DOES_NOT_MATTER', port=0000)
            self.proxy._driver = MagicMock()

        self.entity_type = 'TEST_ENTITY'
        self.cluster = 'TEST_CLUSTER'
        self.db = 'TEST_DB'
        self.name = 'TEST_TABLE'
        self.table_uri = f'{self.entity_type}://{self.cluster}.{self.db}/{self.name}'

        self.classification_entity = {
            'classifications': [
                {
                    'typeName': 'PII_DATA',
                    'name': 'PII_DATA'
                },
            ]
        }

        self.test_column = {
            'guid': 'DOESNT_MATTER',
            'typeName': 'COLUMN',
            'attributes': {
                'qualifiedName': 'column@name',
                'type': 'Managed',
                'description': 'column description',
                'position': 1
            }
        }
        self.entity1 = {
            'guid': '1',
            'typeName': self.entity_type,
            'updateTime': 123,
            'attributes': {
                'qualifiedName': 'Table1_Qualified',
                'name': 'Table1',
                'description': 'Dummy Description',
                'owner': '*****@*****.**',
                'columns': [self.test_column],
                'db': {
                    'guid': '-100',
                    'qualifiedName': self.db,
                    'typeName': self.entity_type,
                }
            }
        }
        self.entity1.update(self.classification_entity)

        self.entity2 = {
            'guid': '2',
            'updateTime': 234,
            'typeName': self.entity_type,
            'attributes': {
                'qualifiedName': 'Table2_Qualified',
                'name': 'Table1',
                'description': 'Dummy Description',
                'owner': '*****@*****.**',
                'db': {
                    'guid': '-100',
                    'qualifiedName': self.db,
                    'typeName': self.entity_type,
                }
            }
        }
        self.entity2.update(self.classification_entity)
        self.entities = {
            'entities': [
                self.entity1,
                self.entity2,
            ]
        }
    def setUp(self):
        self.app = create_app(
            config_module_class='metadata_service.config.LocalConfig')
        self.app_context = self.app.app_context()
        self.app_context.push()

        with patch('metadata_service.proxy.atlas_proxy.Atlas'):
            # Importing here to make app context work before
            # importing `current_app` indirectly using the AtlasProxy
            from metadata_service.proxy.atlas_proxy import AtlasProxy
            self.proxy = AtlasProxy(host='DOES_NOT_MATTER', port=0000)
            self.proxy._driver = MagicMock()

        self.entity_type = 'TEST_ENTITY'
        self.cluster = 'TEST_CLUSTER'
        self.db = 'TEST_DB'
        self.name = 'TEST_TABLE'
        self.table_uri = f'{self.entity_type}://{self.cluster}.{self.db}/{self.name}'

        self.classification_entity = {
            'classifications': [
                {
                    'typeName': 'PII_DATA',
                    'name': 'PII_DATA'
                },
            ]
        }

        self.test_column = {
            'guid': 'DOESNT_MATTER',
            'typeName': 'COLUMN',
            'attributes': {
                'qualifiedName': 'column@name',
                'type': 'Managed',
                'description': 'column description',
                'position': 1
            }
        }

        self.db_entity = {
            'guid': '-100',
            'updateTime': 234,
            'typeName': self.entity_type,
            'attributes': {
                'qualifiedName': self.db,
                'name': 'self.db',
                'description': 'Dummy DB Description',
                'owner': '*****@*****.**',
            }
        }

        self.entity1 = {
            'guid': '1',
            'typeName': self.entity_type,
            'updateTime': 123,
            'attributes': {
                'qualifiedName': 'Table1_Qualified',
                'name': 'Table1',
                'description': 'Dummy Description',
                'owner': '*****@*****.**',
                'columns': [self.test_column],
                'db': self.db_entity
            },
            'relationshipAttributes': {
                'db': self.db_entity,
                'columns': [self.test_column],
            },
        }
        self.entity1.update(self.classification_entity)

        self.entity2 = {
            'guid': '2',
            'updateTime': 234,
            'typeName': self.entity_type,
            'attributes': {
                'qualifiedName': 'Table2_Qualified',
                'name': 'Table1',
                'description': 'Dummy Description',
                'owner': '*****@*****.**',
                'db': self.db_entity
            },
            'relationshipAttributes': {
                'db': self.db_entity,
            },
        }
        self.entity2.update(self.classification_entity)
        self.entities = {
            'entities': [
                self.entity1,
                self.entity2,
            ]
        }