Commit b7ecdc03 authored by Lauri Himanen's avatar Lauri Himanen

Fixed issue in trying to form path to nonexisting cubefile.

parent a26e1820
......@@ -566,9 +566,11 @@ class CP2KCommonParser(CommonParser):
# Cell dependent basis mapping
self.cache_service.addValue("mapping_section_basis_set_cell_dependent")
# If a cube file was found, open it and store values.
# If a cube file was found, get the filepath. Currently no information
# is read from this file because there is no suitable metainfo for it.
filename = self.cache_service["electron_density_filename"]
absolute_filepath = self.parser_context.file_service.get_absolute_path_to_file(filename)
if filename is not None:
self.parser_context.file_service.get_absolute_path_to_file(filename)
backend.closeSection("section_basis_set", scc_basis_id)
......
......@@ -1330,14 +1330,7 @@ class TestCubeFiles(unittest.TestCase):
"""Tests that different methods are recognized correctly.
"""
def test_electron_density(self):
results = get_result("cube/single_point_default_name")
class TestMD(unittest.TestCase):
"""Tests that different methods are recognized correctly.
"""
def test_md(self):
results = get_result("../../test/examples/md")
get_result("cube/single_point_default_name")
if __name__ == '__main__':
......@@ -1349,30 +1342,29 @@ if __name__ == '__main__':
for VERSION in VERSIONS:
suites = []
# suites.append(unittest.TestLoader().loadTestsFromTestCase(TestErrors))
# suites.append(unittest.TestLoader().loadTestsFromTestCase(TestUnknownInput))
# suites.append(unittest.TestLoader().loadTestsFromTestCase(TestXCFunctional))
# suites.append(unittest.TestLoader().loadTestsFromTestCase(TestEnergyForce))
# suites.append(unittest.TestLoader().loadTestsFromTestCase(TestGeometryInfo))
# suites.append(unittest.TestLoader().loadTestsFromTestCase(TestStressTensorMethods))
# suites.append(unittest.TestLoader().loadTestsFromTestCase(TestSelfInteractionCorrectionMethod))
# suites.append(unittest.TestLoader().loadTestsFromTestCase(TestConfigurationPeriodicDimensions))
# suites.append(unittest.TestLoader().loadTestsFromTestCase(TestSCFConvergence))
# suites.append(unittest.TestLoader().loadTestsFromTestCase(TestForceFiles))
# suites.append(unittest.TestLoader().loadTestsFromTestCase(TestPreprocessor))
# suites.append(unittest.TestLoader().loadTestsFromTestCase(TestGeoOpt))
# suites.append(unittest.TestLoader().loadTestsFromTestCase(TestGeoOptTrajFormats))
# suites.append(unittest.TestLoader().loadTestsFromTestCase(TestGeoOptOptimizers))
# suites.append(unittest.TestLoader().loadTestsFromTestCase(TestGeoOptTrajectory))
# suites.append(unittest.TestLoader().loadTestsFromTestCase(TestRestart))
# suites.append(unittest.TestLoader().loadTestsFromTestCase(TestMD))
# suites.append(unittest.TestLoader().loadTestsFromTestCase(TestMDPrintSettings))
# suites.append(unittest.TestLoader().loadTestsFromTestCase(TestMDEnsembles))
# suites.append(unittest.TestLoader().loadTestsFromTestCase(TestMDEnsembles))
# suites.append(unittest.TestLoader().loadTestsFromTestCase(TestVDWMethod))
# suites.append(unittest.TestLoader().loadTestsFromTestCase(TestElectronicStructureMethod))
# suites.append(unittest.TestLoader().loadTestsFromTestCase(TestCubeFiles))
suites.append(unittest.TestLoader().loadTestsFromTestCase(TestErrors))
suites.append(unittest.TestLoader().loadTestsFromTestCase(TestUnknownInput))
suites.append(unittest.TestLoader().loadTestsFromTestCase(TestXCFunctional))
suites.append(unittest.TestLoader().loadTestsFromTestCase(TestEnergyForce))
suites.append(unittest.TestLoader().loadTestsFromTestCase(TestGeometryInfo))
suites.append(unittest.TestLoader().loadTestsFromTestCase(TestStressTensorMethods))
suites.append(unittest.TestLoader().loadTestsFromTestCase(TestSelfInteractionCorrectionMethod))
suites.append(unittest.TestLoader().loadTestsFromTestCase(TestConfigurationPeriodicDimensions))
suites.append(unittest.TestLoader().loadTestsFromTestCase(TestSCFConvergence))
suites.append(unittest.TestLoader().loadTestsFromTestCase(TestForceFiles))
suites.append(unittest.TestLoader().loadTestsFromTestCase(TestPreprocessor))
suites.append(unittest.TestLoader().loadTestsFromTestCase(TestGeoOpt))
suites.append(unittest.TestLoader().loadTestsFromTestCase(TestGeoOptTrajFormats))
suites.append(unittest.TestLoader().loadTestsFromTestCase(TestGeoOptOptimizers))
suites.append(unittest.TestLoader().loadTestsFromTestCase(TestGeoOptTrajectory))
suites.append(unittest.TestLoader().loadTestsFromTestCase(TestRestart))
suites.append(unittest.TestLoader().loadTestsFromTestCase(TestMD))
suites.append(unittest.TestLoader().loadTestsFromTestCase(TestMDPrintSettings))
suites.append(unittest.TestLoader().loadTestsFromTestCase(TestMDEnsembles))
suites.append(unittest.TestLoader().loadTestsFromTestCase(TestMDEnsembles))
suites.append(unittest.TestLoader().loadTestsFromTestCase(TestVDWMethod))
suites.append(unittest.TestLoader().loadTestsFromTestCase(TestElectronicStructureMethod))
suites.append(unittest.TestLoader().loadTestsFromTestCase(TestCubeFiles))
alltests = unittest.TestSuite(suites)
result = unittest.TextTestRunner(verbosity=0).run(alltests)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment