Skip to content

Commit

Permalink
Merge pull request #145 from granrothge/master
Browse files Browse the repository at this point in the history
Fixes yaml loader issue with yaml 6.0
  • Loading branch information
yxqd authored Aug 19, 2022
2 parents 508ab31 + 75faa96 commit ca045fb
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
2 changes: 1 addition & 1 deletion multiphonon/ui/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
8 changes: 8 additions & 0 deletions tests/ui/getdos_TestCase.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit ca045fb

Please sign in to comment.