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)
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')
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')
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)
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)
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()
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()
def test_calls_delete_if_asset_already_exists(self): upload.upload_brave(self.repo, self.release, self.file_path) self.asset.delete.assert_called()
def test_calls_uploads_checksum(self): upload.upload_brave(self.repo, self.release, self.file_path)