Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix FileInput.save #3579

Merged
merged 4 commits into from Jun 6, 2022
Merged

Fix FileInput.save #3579

merged 4 commits into from Jun 6, 2022

Conversation

Hoxbro
Copy link
Member

@Hoxbro Hoxbro commented May 31, 2022

Fixes #3578

Copy link
Member

@maximlt maximlt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the quick PR!!! Could you also add this test?

import pathlib

...

def test_file_input_save_one_file(document, comm, tmpdir):
    file_input = FileInput(accept='.txt')

    widget = file_input.get_root(document, comm=comm)

    assert isinstance(widget, BkFileInput)

    file_input._process_events({'mime_type': 'text/plain', 'value': 'U29tZSB0ZXh0Cg==', 'filename': 'testfile'})

    fpath = pathlib.Path(tmpdir) / 'out.txt'
    file_input.save(str(fpath))

    assert fpath.exists()
    content = fpath.read_text()
    assert content == 'Some text\n'

panel/widgets/input.py Outdated Show resolved Hide resolved
@maximlt
Copy link
Member

maximlt commented Jun 2, 2022

Thanks for the changes! The test suite is still broken due to the latest release of HoloViews, we'll have to re-run the tests when this is fixed.

Copy link
Member

@philippjfr philippjfr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @Hoxbro, great and quick work as always!

@philippjfr philippjfr merged commit d099bf3 into holoviz:master Jun 6, 2022
@Hoxbro Hoxbro deleted the fix_fileinput_save branch June 7, 2022 07:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

FileInput broken in panel v0.13.1
3 participants