@@ -455,9 +455,9 @@ def test_get_kpoints(self):
455
455
assert kpoints .kpts == [[25 ]]
456
456
assert kpoints .style == Kpoints .supported_modes .Automatic
457
457
458
- recip_paramset = MPRelaxSet (self .structure , force_gamma = True )
459
- recip_paramset .kpoints_settings = {"reciprocal_density" : 40 }
460
- kpoints = recip_paramset .kpoints
458
+ recip_param_set = MPRelaxSet (self .structure , force_gamma = True )
459
+ recip_param_set .kpoints_settings = {"reciprocal_density" : 40 }
460
+ kpoints = recip_param_set .kpoints
461
461
assert kpoints .kpts == [[2 , 4 , 5 ]]
462
462
assert kpoints .style == Kpoints .supported_modes .Gamma
463
463
@@ -540,24 +540,17 @@ def test_incar_lmaxmix(self):
540
540
541
541
@skip_if_no_psp_dir
542
542
def test_write_input (self ):
543
- self .mit_set .write_input ("." , make_dir_if_not_present = True )
544
- for file in ["INCAR" , "KPOINTS" , "POSCAR" , "POTCAR" ]:
545
- assert os .path .isfile (file )
546
- assert not os .path .isfile ("Fe4P4O16.cif" )
547
-
548
- self .mit_set .write_input ("." , make_dir_if_not_present = True , include_cif = True )
549
- assert os .path .isfile ("Fe4P4O16.cif" )
550
- for file in ["INCAR" , "KPOINTS" , "POSCAR" , "POTCAR" , "Fe4P4O16.cif" ]:
551
- os .remove (file )
552
-
553
- self .mit_set .write_input ("." , make_dir_if_not_present = True , potcar_spec = True )
554
-
555
- for file in ["INCAR" , "KPOINTS" , "POSCAR" ]:
556
- assert os .path .isfile (file )
557
- assert not os .path .isfile ("POTCAR" )
558
- assert os .path .isfile ("POTCAR.spec" )
559
- for file in ["INCAR" , "KPOINTS" , "POSCAR" , "POTCAR.spec" ]:
560
- os .remove (file )
543
+ vasp_files = {"INCAR" , "KPOINTS" , "POSCAR" , "POTCAR" }
544
+ self .mit_set .write_input (self .tmp_path )
545
+ assert {* os .listdir (self .tmp_path )} == vasp_files
546
+
547
+ self .mit_set .write_input (self .tmp_path , include_cif = True )
548
+ assert {* os .listdir (self .tmp_path )} == {* vasp_files , "Fe4P4O16.cif" }
549
+
550
+ @skip_if_no_psp_dir
551
+ def test_write_input_potcar_spec (self ):
552
+ self .mit_set .write_input (self .tmp_path , potcar_spec = True )
553
+ assert {* os .listdir (self .tmp_path )} == {"INCAR" , "KPOINTS" , "POSCAR" , "POTCAR.spec" }
561
554
562
555
@skip_if_no_psp_dir
563
556
def test_user_potcar_settings (self ):
0 commit comments