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
|
2016-03-11 11:41:37 +01:00
|
|
|
from pytriqs.applications.dft.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,
|
|
|
|
'dosmesh': {'n_points': 101, 'emin': -8.0, 'emax': 4.0}}
|
2015-08-12 12:10:31 +02:00
|
|
|
self.assertDictEqual(res, expected)
|
|
|
|
|
|
|
|
|
|
|
|
|