Пример #1
0
 def test_random_file_name_with_id(self):
     obj = RandomFileName("submission_files/submission_{id}")
     filepath = obj.__call__(self.submission, self.test_file_path)
     expected = "submission_files/submission_{}/{}".format(
         self.submission.pk,
         filepath.split("/")[2])
     self.assertEqual(filepath, expected)
Пример #2
0
 def test_random_file_name_without_id(self):
     obj = RandomFileName("evaluation_scripts")
     filepath = obj.__call__(self.challenge, self.test_file_path)
     expected = "evaluation_scripts/{}".format(filepath.split('/')[1])
     self.assertEqual(filepath, expected)