From 9e7ff5a41c87f69ed30aa71f10e472c3f58229aa Mon Sep 17 00:00:00 2001 From: Garrett Granroth Date: Thu, 18 Aug 2022 17:48:20 -0400 Subject: [PATCH 1/2] added independent test case for context to_yaml and from_yaml --- tests/ui/getdos_TestCase.py | 8 ++++++++ 1 file changed, 8 insertions(+) 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 From 75faa9685ba1a7baec433c71564d6fbb3a8a2b8a Mon Sep 17 00:00:00 2001 From: Garrett Granroth Date: Thu, 18 Aug 2022 17:49:52 -0400 Subject: [PATCH 2/2] fix for yaml6.0 issue --- multiphonon/ui/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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