Tests Used for this Project

We use pytest to run tests. The tests are located in the tests directory.

Tests for each function

  • test_download_dataset.py tests the DownloadDataset function. It tests that the function returns the correct data type and that the data is downloaded correctly.

  • test_LeaftoGraph.py tests the LeaftoGraph function. It tests that the function returns the correct nodes and edges. It is also tested with the wrong input data.

  • test_ComputeMergeTree.py tests the ComputeMergeTree function. It tests that the function returns the correct data type. It also checks that merge trees in both horizontal and vertical orientations are presnet in the output.

Not every function can be tested. Below is a list of functions that are not tested and why:

  • GetLeafData could not be tested because it calls anothe function inside it. The function it calls is DownloadDataset which is tested. I tried to set up a mock for DownloadDataset but it did not work.

  • GetCoordinates was attempted to be tested but it requires a dataframe with a specific format. I tried to create a mock dataframe but it did not work.

  • DataVisualization is not tested because it is a function with no return value. It draws the leaf from the graph data.