3
0
mirror of https://github.com/triqs/dft_tools synced 2024-06-22 13:12:21 +02:00

Completed 'test_parse_groups()'

This commit is contained in:
Oleg E. Peil 2015-02-16 11:46:26 +01:00 committed by Michel Ferrero
parent 3516ebd285
commit 8b60a91e49
2 changed files with 38 additions and 0 deletions

View File

@ -0,0 +1,29 @@
[General]
[Group 1]
SHELLS = 1 2
EMIN = -7.6
EMAX = 3.0
[Group 2]
SHELLS = 3
EMIN = -1.6
EMAX = 2.0
[Shell 1]
LSHELL = 2
IONS = 5..8
[Shell 2]
LSHELL = 1
IONS = 1..4
RTRANSFORM = 0.0 1.0 0.0
1.0 0.0 0.0
0.0 0.0 1.0
[Shell 3]
LSHELL = 3
IONS = 1..4

View File

@ -268,6 +268,15 @@ class TestSpecialParsers(unittest.TestCase):
with self.assertRaisesRegexp(Exception, err_mess):
conf_pars.parse_groups()
# Scenario 2
conf_pars = ConfigParameters('test7.cfg')
conf_pars.parse_groups()
res = conf_pars.groups
expected = [{'index': 1, 'shells': [1, 2], 'emin': -7.6, 'emax': 3.0},
{'index': 2, 'shells': [3], 'emin': -1.6, 'emax': 2.0}]
self.assertListEqual(res, expected)
################################################################################
#
# test_parse_input()