Skip to content

Commit

Permalink
fix path and use stronger assert
Browse files Browse the repository at this point in the history
  • Loading branch information
DanielYang59 committed Mar 11, 2024
1 parent e7ae000 commit f8cbd04
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion pymatgen/apps/borg/hive.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ class VaspToComputedEntryDrone(AbstractDrone):
There are some restrictions on the valid directory structures:
1. There can be only one vasp run in each directory.
1. There can be only one vasprun in each directory.
2. Directories designated "relax1", "relax2" are considered to be 2 parts
of an aflow style run, and only "relax2" is parsed.
3. The drone parses only the vasprun.xml file.
Expand Down
2 changes: 1 addition & 1 deletion tests/apps/borg/test_hive.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ def test_assimilate(self):
assert entry.reduced_formula == "Xe"
assert entry.energy == approx(0.5559329)

entry = self.structure_drone.assimilate(".")
entry = self.structure_drone.assimilate(f"{TEST_FILES_DIR}/app_borg/test_dir")
assert entry.reduced_formula == "Xe"
assert entry.energy == approx(0.5559329)
assert isinstance(entry, ComputedStructureEntry)
Expand Down
2 changes: 2 additions & 0 deletions tests/apps/borg/test_queen.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,12 @@

class TestBorgQueen(unittest.TestCase):
def test_get_data(self):
"""Test get data from vasprun.xml.xe.gz file."""
drone = VaspToComputedEntryDrone()
queen = BorgQueen(drone, TEST_DIR, 1)
data = queen.get_data()
assert len(data) == 1
assert data[0].energy == 0.5559329

def test_load_data(self):
drone = VaspToComputedEntryDrone()
Expand Down

0 comments on commit f8cbd04

Please sign in to comment.