Skip to content

Commit

Permalink
add a test case for the argument 'structure' in geometry_from_pubchem
Browse files Browse the repository at this point in the history
  • Loading branch information
hay-k committed Nov 28, 2019
1 parent 7cbd575 commit c7f2b05
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions src/openfermion/utils/_pubchem_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,3 +76,16 @@ def test_none(self):
none_geometry = geometry_from_pubchem('none')

self.assertIsNone(none_geometry)

def test_water_2d(self):
water_geometry = geometry_from_pubchem('water', structure='2d')
self.water_natoms = len(water_geometry)

water_natoms = 3
self.assertEqual(water_natoms, self.water_natoms)

self.oxygen_z_1 = water_geometry[0][1][2]
self.oxygen_z_2 = water_geometry[1][1][2]
z = 0
self.assertEqual(z, self.oxygen_z_1)
self.assertEqual(z, self.oxygen_z_2)

0 comments on commit c7f2b05

Please sign in to comment.