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.pytests theDownloadDatasetfunction. It tests that the function returns the correct data type and that the data is downloaded correctly. -
test_LeaftoGraph.pytests theLeaftoGraphfunction. It tests that the function returns the correct nodes and edges. It is also tested with the wrong input data. -
test_ComputeMergeTree.pytests theComputeMergeTreefunction. 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:
-
GetLeafDatacould not be tested because it calls anothe function inside it. The function it calls isDownloadDatasetwhich is tested. I tried to set up a mock forDownloadDatasetbut it did not work. -
GetCoordinateswas 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. -
DataVisualizationis not tested because it is a function with no return value. It draws the leaf from the graph data.