Skip to content

Commit

Permalink
test: change root folder test
Browse files Browse the repository at this point in the history
  • Loading branch information
dfguerrerom committed Aug 8, 2023
1 parent 9a2b8ca commit fe45714
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions tests/test_sepalwidgets/test_FileInput.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
from pathlib import Path
from typing import List

import ipyvuetify as v
import pytest
from traitlets import Any

Expand Down Expand Up @@ -170,9 +169,18 @@ def test_root(file_input: sw.FileInput, root_dir: Path) -> None:
# set the root to the current folder and reload
file_input.root = str(root_dir)
file_input._on_reload()
first_title_item = file_input.get_children(klass=v.ListItemTitle)[0]

assert ".. /" not in first_title_item.children[0]
current_items = file_input.file_list

# Try to go to the parent root folder
root_parent = Path(file_input.root).parent

file_input._on_file_select({"new": root_parent})

new_items = file_input.file_list

# Assert that trying to go to the parent root folder does not work
assert current_items == new_items

return

Expand Down

0 comments on commit fe45714

Please sign in to comment.