Coverage for gpaw/test/setups/test_setup_data.py: 100%

13 statements  

« prev     ^ index     » next       coverage.py v7.7.1, created at 2025-07-14 00:18 +0000

1import os 

2import subprocess 

3 

4import pytest 

5 

6from gpaw.setup_data import SetupData, read_maybe_unzipping 

7 

8 

9@pytest.mark.serial 

10def test_parsing_core_hole_state(in_tmp_dir): 

11 """ 

12 Test for parsing a core-hole state from an XML file. 

13 """ 

14 subprocess.run(['gpaw', 'dataset', 

15 '--tag', 'mysetup', '--core-hole', '3s,1', '-w', 'Ti']) 

16 assert os.path.isfile('Ti.mysetup.LDA') 

17 setup = SetupData('Ti', 'LDA', readxml=False) 

18 setup.read_xml(read_maybe_unzipping('Ti.mysetup.LDA')) 

19 assert setup.ncorehole == 3 

20 assert setup.lcorehole == 0 

21 assert setup.fcorehole == 1