summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/test_collection.py7
1 files changed, 3 insertions, 4 deletions
diff --git a/tests/test_collection.py b/tests/test_collection.py
index 7d2dc72..a55261f 100644
--- a/tests/test_collection.py
+++ b/tests/test_collection.py
@@ -76,7 +76,6 @@ class testCollectionLoading(unittest.TestCase):
self.assertEqual(entry.uid, '11189ee47ddf4796b718a483b379f976')
-
class testEntries(unittest.TestCase):
def setUp(self):
self.collection = lesana.Collection('tests/data/simple')
@@ -89,13 +88,13 @@ class testEntries(unittest.TestCase):
def test_simple(self):
fname = '085682ed-6792-499d-a3ab-9aebd683c011.yaml'
with open(os.path.join(self.basepath, fname)) as fp:
- data = ruamel.yaml.load(fp)
+ data = ruamel.yaml.safe_load(fp)
entry = lesana.Entry(self.collection, data=data, fname=fname)
self.assertEqual(entry.idterm, 'Q'+data['uid'])
fname = '11189ee47ddf4796b718a483b379f976.yaml'
uid = '11189ee47ddf4796b718a483b379f976'
with open(os.path.join(self.basepath, fname)) as fp:
- data = ruamel.yaml.load(fp)
+ data = ruamel.yaml.safe_load(fp)
entry = lesana.Entry(self.collection, data=data, fname=fname)
self.assertEqual(entry.idterm, 'Q'+uid)
@@ -104,7 +103,7 @@ class testEntries(unittest.TestCase):
self.collection.save_entries(entries=[new_entry])
entry_fname = 'tests/data/simple/items/' + new_entry.fname
with open(entry_fname) as fp:
- written = ruamel.yaml.load(fp)
+ written = ruamel.yaml.safe_load(fp)
self.assertIsInstance(written['quantity'], int)
self.assertIsInstance(written['name'], str)
os.remove(entry_fname)