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
|
|
|
|
from inpconf import ConfigParameters
|
|
|
|
|
|
|
|
################################################################################
|
|
|
|
#
|
|
|
|
# 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
|
|
|
|
expected = {'basename': 'test_base', 'efermi': 0.1}
|
|
|
|
self.assertDictEqual(res, expected)
|
|
|
|
|
|
|
|
|
|
|
|
|