2018-05-04 16:26:47 +02:00
|
|
|
|
|
|
|
import os
|
|
|
|
import rpath
|
|
|
|
_rpath = os.path.dirname(rpath.__file__) + '/'
|
|
|
|
|
2018-12-04 18:59:02 +01:00
|
|
|
from triqs_dft_tools.converters.plovasp.converter import generate_and_output_as_text
|
|
|
|
from triqs_dft_tools.converters import VaspConverter
|
2018-05-04 16:26:47 +02:00
|
|
|
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'
|
2018-08-01 11:48:28 +02:00
|
|
|
converter = VaspConverter(filename=_rpath + 'one_site',
|
2018-05-04 16:26:47 +02:00
|
|
|
hdf_filename=test_file)
|
|
|
|
|
|
|
|
converter.convert_dft_input()
|
|
|
|
|
2020-06-10 17:45:53 +02:00
|
|
|
expected_file = _rpath + 'pg_output.ref.h5'
|
2018-05-04 16:26:47 +02:00
|
|
|
self.assertH5FileEqual(test_file, expected_file)
|
|
|
|
|
|
|
|
if __name__ == '__main__':
|
|
|
|
import unittest
|
|
|
|
unittest.main(verbosity=2, buffer=False)
|