def test_error_if_lattice_parameter_missing_from_dict(self): lattice_parameters = {"a_star": 0.2314, "c_star": 0.0588, "alpha_star": 90, "beta_star": 90, "gamma_star": 60} with pytest.raises(ValueError) as exception_info: ReciprocalLattice.from_dict(lattice_parameters) assert str(exception_info.value) == "Parameter: 'b_star' missing from input dictionary"
def test_can_create_crystal_from_dictionary(self): lattice_parameters = {"a_star": 0.2314, "b_star": 0.2314, "c_star": 0.0588, "alpha_star": 90, "beta_star": 90, "gamma_star": 60} lattice = ReciprocalLattice.from_dict(lattice_parameters) assert lattice.lattice_parameters == CALCITE_RECIPROCAL_LATTICE_PARAMETERS