2015-08-10 11:32:08 +02:00
|
|
|
r"""
|
|
|
|
Tests for class 'Doscar' from module 'vaspio'
|
|
|
|
"""
|
2015-10-16 11:52:33 +02:00
|
|
|
import os
|
2020-08-03 12:17:16 +02:00
|
|
|
import rpath
|
2015-10-16 11:52:33 +02:00
|
|
|
_rpath = os.path.dirname(rpath.__file__) + '/'
|
|
|
|
|
2020-08-03 12:17:16 +02:00
|
|
|
import mytest
|
2015-08-10 11:32:08 +02:00
|
|
|
import numpy as np
|
2018-09-06 13:48:24 +02:00
|
|
|
from triqs_dft_tools.converters.plovasp.vaspio import Doscar
|
2015-08-10 11:32:08 +02:00
|
|
|
|
|
|
|
################################################################################
|
|
|
|
#
|
|
|
|
# TestDoscar
|
|
|
|
#
|
|
|
|
################################################################################
|
|
|
|
class TestDoscar(mytest.MyTestCase):
|
|
|
|
"""
|
|
|
|
Function:
|
|
|
|
|
|
|
|
def Doscar.from_file(vasp_dir, dos_filename)
|
|
|
|
|
|
|
|
Scenarios:
|
|
|
|
- correct DOSCAR file
|
|
|
|
|
|
|
|
"""
|
|
|
|
# Scenario 1
|
|
|
|
def test_example(self):
|
|
|
|
filename = 'DOSCAR.example'
|
|
|
|
doscar = Doscar()
|
2015-10-16 11:52:33 +02:00
|
|
|
doscar.from_file(vasp_dir=_rpath, dos_filename=filename)
|
2015-08-10 11:32:08 +02:00
|
|
|
|
|
|
|
test_efermi = doscar.efermi
|
|
|
|
expected = 5.84395237
|
|
|
|
self.assertAlmostEqual(test_efermi, expected)
|
|
|
|
|