Skip to content
This repository has been archived by the owner on Aug 25, 2023. It is now read-only.

Documentation of "how-to-do-testing" #212

Open
LauJohansson opened this issue Dec 1, 2022 · 0 comments
Open

Documentation of "how-to-do-testing" #212

LauJohansson opened this issue Dec 1, 2022 · 0 comments
Labels
documentation Improvements or additions to documentation

Comments

@LauJohansson
Copy link
Contributor

LauJohansson commented Dec 1, 2022

We could make a short example of how to do testing of a ETL flow using the TestHandle.

from atc_tools.testing.TestHandle import TestHandle
from atc.utils import DataframeCreator

test_schema =  ...
test_columns = ...
test_data = ...
expected_data = ...

params = BusinessETLParameters()

params.source_dh =  TestHandle(
            provides=DataframeCreator.make_partial(
                test_schema , 
                test_columns,
                 test_data 
            )
        )

params.target_dh =  TestHandle(
            provides=DataframeCreator.make_partial(
                test_schema , 
                test_columns,
                 test_data 
            )
        )

orchestrator= BusinessETLOrchestrator(params)

orchestrator.execute()

self.assertDataframeMatches(params.target.overwritten, None, expected_data )
@LauJohansson LauJohansson added the documentation Improvements or additions to documentation label Dec 1, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

No branches or pull requests

1 participant