Пример #1
0
 def test_upload_challenge_file_uploader_is_none(self):
     temp_dir = tempfile.mkdtemp()
     try:
         params = D3RParameters()
         chall = ChallengeDataTask(temp_dir, params)
         chall._upload_challenge_file('/foo')
         self.assertEqual(chall.get_email_log(), 'No uploader available '
                                                 'to upload challenge '
                                                 'data\n')
     finally:
         shutil.rmtree(temp_dir)
Пример #2
0
 def test_upload_challenge_file_no_remote_challenge_dir(self):
     temp_dir = tempfile.mkdtemp()
     try:
         params = D3RParameters()
         chall = ChallengeDataTask(temp_dir, params)
         ftp = FtpFileTransfer(None)
         chall.set_file_transfer(ftp)
         chall._upload_challenge_file('/foo')
         self.assertEqual(chall.get_email_log(), 'No remote challenge'
                                                 ' directory set for '
                                                 'ftp upload\n')
     finally:
         shutil.rmtree(temp_dir)
Пример #3
0
    def test_upload_challenge_file_challenge_file_is_none(self):
        temp_dir = tempfile.mkdtemp()
        try:
            params = D3RParameters()

            chall = ChallengeDataTask(temp_dir, params)
            chall._upload_challenge_file(None)
            chall.set_file_transfer(params)
            self.assertEqual(chall.get_email_log(), 'challenge_file is None in'
                                                    ' _upload_challenge_file'
                                                    '\n')
        finally:
            shutil.rmtree(temp_dir)