Skip to content

Implement integration test

Please update the dummy classifications we use for testing to fulfil the following requirements

  • reduce the mocked lulc utility class description to 3 classes: forest, built-up, unknown
  • replace the current before and after classifications so that each of the 9 combination permutations is present
    • forest->forest
    • forest->built-up
    • forest->unknown
    • built-up->built-up
    • built-up->forest
    • ...
  • in test_plugin_compute read in all produced artifacts (the data stored in the files, not the metadata) and assert their content matches your expectations. Example code:
    for artifact in artifacts:
        match artifact.name:
            case 'Change areas and emissions by LULC change type':
                expected_change_type_table = pd.DataFrame(
                    {'Change': ['farmland to built-up', 'grass to farmland', 'forest to grass'],
                     'Area [ha]': [0.01, 0.01, 0.01],
                     'Total emissions [t]': [0.37, 0.54, 0.92]})
                exported_df = pd.read_csv(artifact.file_path)
                pd.testing.assert_frame_equal(exported_df, expected_change_type_table)

This issue comes from !30 (merged) discussion:

  • @madamiak started a discussion: (+3 comments)

    I feel that the class needs a simple integration test of an area in which there was no change indicated. It will make me calm that all interactions with data frames are proper.

/cc @madamiak