def test_read_cosmo_params_from_hdf5_file(): hdf5_file = file_utils.open_hdf5_file() hdf5_cosmo_params = file_utils.read_cosmo_params_from_hdf5_file(hdf5_file) hdf5_file.close() assert_that(hdf5_cosmo_params, is_(equal_to( { u'a': 0.99999999999999978, u'OmegaB': 0.041799999999999997, u'Rhocrit': 147855851175.47427, u'G': 4.3021802231391631e-09, u'OmegaL': 0.76200000000000001, u'h': 0.72999999999999998, u'Rhoback': 35189692579.762878, u'H_of_a': 73.0, u'OmegaZ': 0.23800000000000016, u'z': '', u'Omega0': 0.23799999999999999} )))
def test_open_hdf5_file(): hdf5_file = file_utils.open_hdf5_file() assert_that(hdf5_file.mode, is_(equal_to('r'))) hdf5_file.close()