diff --git a/multiphonon/ui/__init__.py b/multiphonon/ui/__init__.py index 1be36d6..00b6a9b 100644 --- a/multiphonon/ui/__init__.py +++ b/multiphonon/ui/__init__.py @@ -31,7 +31,7 @@ def to_yaml(self, path): return def from_yaml(self, path): with open(path) as stream: - d = yaml.load(stream) + d = yaml.load(stream,Loader=yaml.FullLoader) for k, v in d.items(): setattr(self, k,v) continue diff --git a/tests/ui/getdos_TestCase.py b/tests/ui/getdos_TestCase.py index 9a66139..f1f5067 100644 --- a/tests/ui/getdos_TestCase.py +++ b/tests/ui/getdos_TestCase.py @@ -16,6 +16,14 @@ import unittest class TestCase(unittest.TestCase): + def test_contextload(self): + from multiphonon.ui import Context + cntxt = Context() + cntxt.to_yaml('context.yaml') + cntxt2 = Context() + cntxt2.from_yaml('context.yaml') + return + def test1(self): "multiphonon.ui.getdos" from multiphonon.ui import getdos