CoreyMorris/MMLU-by-task-Leaderboard
16
1import unittest2import os3 4class TestPaths(unittest.TestCase):5 def test_path_exists(self):6 # test that the path results exists7 self.assertTrue(os.path.exists('results'))8 9 def test_results_directory_is_not_empty(self):10 # test that the results directory is not empty11 self.assertGreater(len(os.listdir('results')), 0)12 13 def test_results_contain_json_files(self):14 # test that the results director contains json files in the sub directores15 # get a list of all the subdirectories16 subdirectories = [x[0] for x in os.walk('results')]17 # check if the subdirectories contain json files. only check one subdirectory18 subdirectory = subdirectories[1]19 self.assertGreater(len(os.listdir(subdirectory)), 0)