Example #1
0
 def test_force_delete_before_upload_when_force_true_with_filename_override(
         self):
     fake_filename = 'fake-name-here'
     upload.upload_brave(self.repo, self.release, self.file_path,
                         fake_filename, True)
     upload.delete_file.assert_called_with(self.repo, self.release,
                                           fake_filename)
Example #2
0
    def test_calls_upload(self):
        upload.upload_brave(self.repo, self.release, self.file_path)
        upload.upload_io_to_github.assert_called()

        args, kwargs = upload.upload_io_to_github.call_args
        self.assertTrue(args[0] == self.repo)
        self.assertTrue(args[2] == self.release.assets._assets[0].name)
        self.assertTrue(args[4] == 'application/zip')
Example #3
0
    def test_calls_upload_with_filename_override(self):
        fake_filename = 'fake-name-here'
        upload.upload_brave(self.repo, self.release, self.file_path,
                            fake_filename)
        upload.upload_io_to_github.assert_called()

        args, kwargs = upload.upload_io_to_github.call_args
        self.assertTrue(args[0] == self.repo)
        self.assertTrue(args[2] == fake_filename)
        self.assertTrue(args[4] == 'application/zip')
Example #4
0
 def test_calls_uploads_checksum(self):
     upload.upload_brave(self.repo, self.release, self.file_path)
     upload.upload_sha256_checksum.assert_called_with(
         self.release.tag_name, self.file_path)
Example #5
0
 def test_force_delete_before_upload_when_force_true(self):
     upload.upload_brave(self.repo, self.release, self.file_path, None,
                         True)
     upload.delete_file.assert_called_with(
         self.repo, self.release, self.release.assets._assets[0].name)
Example #6
0
 def test_does_not_force_delete_before_upload_when_force_false(self):
     upload.upload_brave(self.repo, self.release, self.file_path)
     upload.delete_file.assert_not_called()
Example #7
0
 def test_does_not_call_delete_if_asset_not_present(self):
     empty_repo = Repo()
     upload.upload_brave(empty_repo, self.release, self.file_path)
     self.asset.delete.assert_not_called()
Example #8
0
 def test_calls_delete_if_asset_already_exists(self):
     upload.upload_brave(self.repo, self.release, self.file_path)
     self.asset.delete.assert_called()
Example #9
0
 def test_calls_uploads_checksum(self):
     upload.upload_brave(self.repo, self.release, self.file_path)