Skip to content

Commit

Permalink
Fix test utils
Browse files Browse the repository at this point in the history
  • Loading branch information
JosePizarro3 committed Apr 8, 2024
1 parent 5e42675 commit d9ac319
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions tests/test_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,21 +30,20 @@ def test_get_sibling_section():
"""
parent_section = ModelSystem()
section = AtomicCell(type='original')
parent_section.atomic_cell.append(section)
parent_section.cell.append(section)
sibling_section = Symmetry()
parent_section.symmetry.append(sibling_section)
assert get_sibling_section(section, '', logger) is None
assert get_sibling_section(section, 'symmetry', logger) == sibling_section
assert get_sibling_section(sibling_section, 'atomic_cell', logger) == section
assert get_sibling_section(sibling_section, 'cell', logger) == section
assert get_sibling_section(section, 'symmetry', logger, index_sibling=2) is None
section2 = AtomicCell(type='primitive')
parent_section.atomic_cell.append(section2)
parent_section.cell.append(section2)
assert (
get_sibling_section(sibling_section, 'atomic_cell', logger, index_sibling=0)
== section
get_sibling_section(sibling_section, 'cell', logger, index_sibling=0) == section
)
assert (
get_sibling_section(sibling_section, 'atomic_cell', logger, index_sibling=1)
get_sibling_section(sibling_section, 'cell', logger, index_sibling=1)
== section2
)

Expand Down

0 comments on commit d9ac319

Please sign in to comment.