From fe6863e6f4cb372722768c1423c12c53dc15faa6 Mon Sep 17 00:00:00 2001 From: shawk masboob <masboob.shawk@gmail.com> Date: Fri, 28 Feb 2020 00:04:43 -0500 Subject: [PATCH] unit testing folder --- test/test_Prediction.py | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 test/test_Prediction.py diff --git a/test/test_Prediction.py b/test/test_Prediction.py new file mode 100644 index 0000000..9cf0f8b --- /dev/null +++ b/test/test_Prediction.py @@ -0,0 +1,28 @@ +import TDA_Prediction as tdap +import pandas as pd +from unittest.mock import patch, Mock + + +# Does the function know +def test_numpy_to_pandas(): + from sklearn.datasets import fetch_california_housing + cal_housing = fetch_california_housing() + value = tdap.numpy_to_pandas(cal_housing) + assert value == df + return + +def test_accuracy_metrics1(): + values = tdap.accuracy_metrics(None, None) + assert values == None + return + +def test_accuracy_metrics2(): + values = tdap.accuracy_metrics({}, None) + assert values == None + return + +def test_descriptive_statistic(): + values = tdap.descriptive_statistic(df, 5) + df = pd.DataFrame({'a':[1,2,3,4,5]}) + assert values == df.shape + return \ No newline at end of file -- GitLab