@@ -610,25 +610,31 @@ def test_pickling(self):
610610# End of class TestStructure
611611
612612
613- @pytest .mark .parametrize (
614- "include_charge_state,expected" ,
615- [
616- (False , ["Pb" ] * 4 + ["Te" ] * 4 ),
617- (True , ["Pb" ] * 4 + ["Te" ] * 4 ),
618- ],
619- )
620- def test_get_chemical_symbols (datafile , include_charge_state , expected ):
613+ def test_get_chemical_symbols (datafile ):
621614 """Check Structure.get_chemical_symbols()"""
622615 pbte_stru = Structure (filename = datafile ("PbTe.cif" ))
623- actual_chemical_symbols = pbte_stru .get_chemical_symbols (include_charge_state = include_charge_state )
624- expected_chemical_symbols = expected
616+ actual_chemical_symbols = pbte_stru .get_chemical_symbols ()
617+ expected_chemical_symbols = [ "Pb" ] * 4 + [ "Te" ] * 4
625618 assert actual_chemical_symbols == expected_chemical_symbols
626619
627620
628- # def test_get_fractional_coordinates(datafile):
629- # """Check Structure.get_fractional_coordinates()"""
630- # pbte_cif = Structure(filename=datafile("PbTe.cif"))
631- # assert False
621+ def test_get_fractional_coordinates (datafile ):
622+ """Check Structure.get_fractional_coordinates()"""
623+ pbte_stru = Structure (filename = datafile ("PbTe.cif" ))
624+ actual_fractional_coords = pbte_stru .get_fractional_coordinates ()
625+ expected_fractional_coords = numpy .array (
626+ [
627+ [0.5 , 0.5 , 0.5 ],
628+ [0.5 , 0.0 , 0.0 ],
629+ [0.0 , 0.5 , 0.0 ],
630+ [0.0 , 0.0 , 0.5 ],
631+ [0.0 , 0.0 , 0.0 ],
632+ [0.0 , 0.5 , 0.5 ],
633+ [0.5 , 0.0 , 0.5 ],
634+ [0.5 , 0.5 , 0.0 ],
635+ ]
636+ )
637+ assert actual_fractional_coords .tolist () == expected_fractional_coords .tolist ()
632638
633639
634640# def test_get_cartesian_coordinates(datafile):
0 commit comments