3
0
mirror of https://github.com/triqs/dft_tools synced 2024-12-23 21:03:45 +01:00
dft_tools/test/python/plovasp/converter/test_converter_one_site.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

43 lines
1.2 KiB
Python

import os
import rpath
_rpath = os.path.dirname(rpath.__file__) + '/'
from triqs_dft_tools.converters.plovasp.converter import generate_and_output_as_text
from triqs_dft_tools.converters import VaspConverter
import mytest
################################################################################
#
# TestConverterOneSite
#
################################################################################
class TestConverterOneSite(mytest.MyTestCase):
"""
Function:
def generate_and_output_as_text(pars, el_struct)
and
VaspConverter
Scenarios:
- Parse config file and produce a correct converted h5-file
"""
# Scenario 1
def test_convert_one_site(self):
generate_and_output_as_text(_rpath + 'example.cfg', _rpath + 'one_site/')
test_file = _rpath + 'pg_output.test.h5'
converter = VaspConverter(filename=_rpath + 'one_site',
hdf_filename=test_file)
converter.convert_dft_input()
expected_file = _rpath + 'pg_output.ref.h5'
self.assertH5FileEqual(test_file, expected_file)
if __name__ == '__main__':
import unittest
unittest.main(verbosity=2, buffer=False)