Skip to content

Commit

Permalink
fix unit-test
Browse files Browse the repository at this point in the history
  • Loading branch information
aimspot committed Jun 26, 2024
1 parent 77649c6 commit 8bbc823
Showing 1 changed file with 16 additions and 10 deletions.
26 changes: 16 additions & 10 deletions tests/unit_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,21 +4,27 @@
project_dir = os.path.dirname(os.path.abspath(__file__))
sys.path.append(os.path.dirname(os.path.dirname(project_dir)))
from ODRS.src.data_processing.ml_processing.recommendation_module import predict_models

from ODRS.src.data_processing.data_utils.utils import load_class_names, get_models, get_data_path

class TestDatasetInfo(unittest.TestCase):
def test_dataset_info(self):
dataset_path = "/home/runner/work/ODRS/src/user_datasets/WaRP/Warp-D"
classes_path = "/home/runner/work/ODRS/src/classes.txt"
run_path = '/home/runner/work/ODRS/src/'

result = predict_models(dataset_path, classes_path, run_path)
def test_load_classes(self):
classes_path = "/home/runner/work/ODRS/src/classes.txt"
result = load_class_names(classes_path)
self.assertIsInstance(result, list)
self.assertEqual(len(result), 28)


def test_models(self):
result = get_models()
self.assertIsInstance(result, list)
self.assertEqual(len(result), 3)
self.assertIsInstance(result[0], int)
self.assertIsInstance(result[1], int)
self.assertIsInstance(result[2], int)
self.assertEqual(len(result), 15)

def test_data_path(self):
default = '/home/runner/work/ODRS/ODRS/user_datasets/WaRP/Warp-D'
result = get_data_path(default)
self.assertEqual(result, default)



if __name__ == "__main__":
Expand Down

0 comments on commit 8bbc823

Please sign in to comment.