2015-08-12 12:10:31 +02:00
|
|
|
r"""
|
|
|
|
Tests of 'parse_general()' defined in ConfigParameters class
|
|
|
|
"""
|
2015-10-16 11:16:48 +02:00
|
|
|
import os
|
|
|
|
import rpath
|
|
|
|
_rpath = os.path.dirname(rpath.__file__) + '/'
|
|
|
|
|
2015-08-12 12:10:31 +02:00
|
|
|
import arraytest
|
|
|
|
import numpy as np
|
2018-09-06 13:48:24 +02:00
|
|
|
from triqs_dft_tools.converters.plovasp.inpconf import ConfigParameters
|
2015-08-12 12:10:31 +02:00
|
|
|
|
|
|
|
################################################################################
|
|
|
|
#
|
|
|
|
# TestParseGeneral
|
|
|
|
#
|
|
|
|
################################################################################
|
|
|
|
class TestParseGeneral(arraytest.ArrayTestCase):
|
|
|
|
"""
|
|
|
|
Function:
|
|
|
|
|
|
|
|
def parse_general(self)
|
|
|
|
|
|
|
|
Scenarios:
|
|
|
|
|
|
|
|
- **if** a correct [General] section is defined **return** a dictionary
|
|
|
|
"""
|
|
|
|
# Scenario 1
|
|
|
|
def test_example(self):
|
2015-10-16 11:16:48 +02:00
|
|
|
conf_pars = ConfigParameters(_rpath + 'example.cfg')
|
2015-08-12 12:10:31 +02:00
|
|
|
conf_pars.parse_general()
|
|
|
|
res = conf_pars.general
|
2015-11-13 13:54:26 +01:00
|
|
|
expected = {'basename': 'test_base', 'efermi': 0.1,
|
2019-06-28 14:47:15 +02:00
|
|
|
'dosmesh': {'n_points': 101, 'emin': -8.0, 'emax': 4.0},
|
|
|
|
'hk' : False}
|
2015-08-12 12:10:31 +02:00
|
|
|
self.assertDictEqual(res, expected)
|
|
|
|
|
|
|
|
|
|
|
|
|