Corey Morris commited on
Commit
a13887a
1 Parent(s): 7622af3

added a test

Browse files
Files changed (1) hide show
  1. test_details_data_processing.py +15 -1
test_details_data_processing.py CHANGED
@@ -70,7 +70,21 @@ class TestDetailsDataProcessor(unittest.TestCase):
70
  self.assertEqual(self.processor.build_url(file_path, harness_type), expected,
71
  f"Test failed for file_path: {file_path}, harness_type: {harness_type}")
72
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
73
 
74
-
75
  if __name__ == '__main__':
76
  unittest.main()
 
70
  self.assertEqual(self.processor.build_url(file_path, harness_type), expected,
71
  f"Test failed for file_path: {file_path}, harness_type: {harness_type}")
72
 
73
+ def test_download_file_filename_format(self):
74
+ url = "https://huggingface.co/datasets/open-llm-leaderboard/details/resolve/main/64bits/LexPodLM-13B/details_harness%7ChendrycksTest-moral_scenarios%7C5_2023-07-25T13%3A41%3A51.227672.json"
75
+ directory = 'details_data'
76
+ error_count, success_count = self.processor.download_file(url, directory)
77
+
78
+ # Check that the download was successful
79
+ self.assertEqual(success_count, 1)
80
+ self.assertEqual(error_count, 0)
81
+
82
+ # Expected file name
83
+ expected_file_name = "64bits_LexPodLM-13B_moral_scenarios.json"
84
+
85
+ # Check that the file was created with the expected name
86
+ self.assertTrue(expected_file_name in os.listdir(directory),
87
+ f"File with expected name {expected_file_name} not found in directory {directory}")
88
 
 
89
  if __name__ == '__main__':
90
  unittest.main()