-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
15 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
from ase.build import molecule | ||
import znh5md | ||
|
||
def test_single_obs_key_info(tmp_path): | ||
# Test a special case where only the first config has the key | ||
# which caused an error in the past | ||
io = znh5md.IO(tmp_path / "test.h5") | ||
water = molecule("H2O") | ||
water.info["density"] = 0.997 | ||
io.append(water) | ||
del water.info["density"] | ||
io.extend([water for _ in range(5)]) | ||
assert len(io) == 6 | ||
assert len(io[:]) == 6 | ||
assert len(list(io)) == 6 |