Skip to content

Commit

Permalink
More tests.
Browse files Browse the repository at this point in the history
  • Loading branch information
yakutovicha committed Oct 9, 2023
1 parent 263d966 commit 8f0559d
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions tests/test_viewers.py
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ def test_structure_data_viwer(structure_data_object):
assert v.selection == [1]

# or of the two selections.
v._selected_atoms.value = "x>0.5 or x<0.5"
v._selected_atoms.value = "x>=0.5 or x<0.5"
v.apply_displayed_selection()
assert v.selection == [0, 1]

Expand Down Expand Up @@ -134,12 +134,22 @@ def test_structure_data_viwer(structure_data_object):
v.structure = None
v.structure = new_structure

# Use "name" operator.
# Use "name" and "not" operators.
v._selected_atoms.value = "z<2 and name B"
v.apply_displayed_selection()
assert v.selection == [0]
assert v.displayed_selection == [0, 4, 8, 12]

v._selected_atoms.value = "z<2 and name not B"
v.apply_displayed_selection()
assert v.selection == [1]
assert v.displayed_selection == [1, 5, 9, 13]

v._selected_atoms.value = "z<2 and name not [B, O]"
v.apply_displayed_selection()
assert v.selection == [1]
assert v.displayed_selection == [1, 5, 9, 13]

# Use "id" operator.
v._selected_atoms.value = "id == 1 or id == 8"
v.apply_displayed_selection()
Expand Down

0 comments on commit 8f0559d

Please sign in to comment.