def test_underlying_platform_cannot_be_other_than_athena(): source = GlueSource( ctx=PipelineContext(run_id="glue-source-test"), config=GlueSourceConfig(aws_region="us-west-2", underlying_platform="data-warehouse"), ) assert source.get_underlying_platform() == "glue"
def test_underlying_platform_takes_precendence(): source = GlueSource( ctx=PipelineContext(run_id="glue-source-test"), config=GlueSourceConfig(aws_region="us-west-2", underlying_platform="athena"), ) assert source.get_underlying_platform() == "athena"
def test_platform_must_be_valid(): with pytest.raises(ConfigurationError): GlueSource( ctx=PipelineContext(run_id="glue-source-test"), config=GlueSourceConfig(aws_region="us-west-2", platform="data-warehouse"), )
def glue_source(platform_instance: Optional[str] = None) -> GlueSource: return GlueSource( ctx=PipelineContext(run_id="glue-source-test"), config=GlueSourceConfig( aws_region="us-west-2", extract_transforms=True, platform_instance=platform_instance, ), )
def test_without_underlying_platform(): source = GlueSource( ctx=PipelineContext(run_id="glue-source-test"), config=GlueSourceConfig(aws_region="us-west-2"), ) assert source.platform == "glue"
def glue_source() -> GlueSource: return GlueSource( ctx=PipelineContext(run_id="glue-source-test"), config=GlueSourceConfig(aws_region="us-west-2", extract_transforms=True), )