3
0
mirror of https://github.com/triqs/dft_tools synced 2024-07-18 00:43:41 +02:00
dft_tools/test/python/plovasp/inpconf/test_general.py
Alexander Hampel 11d394fd5b synchronize dfttools with app4triqs structure
* moved the plovasp C++ code to c++/triqs_dft_tools/converters/vasp
* added global header triqs_dft_tools/triqs_dft_tools.hpp
* python dir based on single cmakelist file
* registered C++ tests for plovasp
* corrected imports for py3 tests for plovasp
* corrected block order in sigma_from_file and srvo3_Gloc
* exchanged ref files for sigma_from_file, srvo3_Gloc, SrVO3.ref.h5
* moved vasp converter bash scripts from dir shells to bin dir
2020-06-10 17:45:53 +02:00

39 lines
1.0 KiB
Python

r"""
Tests of 'parse_general()' defined in ConfigParameters class
"""
import os
from . import rpath
_rpath = os.path.dirname(rpath.__file__) + '/'
from . import arraytest
import numpy as np
from triqs_dft_tools.converters.plovasp.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):
conf_pars = ConfigParameters(_rpath + 'example.cfg')
conf_pars.parse_general()
res = conf_pars.general
expected = {'basename': 'test_base', 'efermi': 0.1,
'dosmesh': {'n_points': 101, 'emin': -8.0, 'emax': 4.0},
'hk' : False}
self.assertDictEqual(res, expected)