Skip to content

Commit

Permalink
Fix test_remove_group for new radical tree structure.
Browse files Browse the repository at this point in the history
The specific groups used in the example have changed.
I came up with new example, that I think tests the same thing.
  • Loading branch information
rwest authored and JacksonBurns committed Apr 1, 2024
1 parent 0824273 commit e563985
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions test/rmgpy/data/thermoTest.py
Original file line number Diff line number Diff line change
Expand Up @@ -1670,15 +1670,15 @@ def test_remove_group(self):
assert rad_group.entries["OJ"].data is group_to_remove.data

# Remove an entry with a ThermoData object
group_to_remove2 = rad_group.entries["CsJ"]
group_to_remove2 = rad_group.entries["Cs_P"]
rad_group.remove_group(group_to_remove2)
# If group_to_remove was a data object, we point toward parent instead
# RJ2_triplet pointed to CsJ, which had data
# After we remove CsJ, RJ2_triplet points to the parent, which was RJ
assert rad_group.entries["RJ2_triplet"].data == group_to_remove2.parent.label
# CsCsJ pointed to Cs_P, which had data.
# After we remove Cs_P, CsCsJ points to the parent, which was CsJ
assert rad_group.entries["CsCsJ"].data == group_to_remove2.parent.label
# If the parent pointed toward group_to_remove, we need should have copied data object
# RJ used to just point at CJ, which pointed at CsJ. After we remove CsJ,
# RJ should contain the data copied from CsJ
# CsJ (the parent) used to just point at Cs_P.
# After we remove Cs_P, CsJ should contain the data copied from Cs_P
Tlist = [300, 400, 500, 600, 800, 1000, 1500]
assert not isinstance(group_to_remove2.parent.data, str)
assert group_to_remove2.parent.data.get_enthalpy(298) == group_to_remove2.data.get_enthalpy(298)
Expand Down

0 comments on commit e563985

Please sign in to comment.