summaryrefslogtreecommitdiff
path: root/tests/unittests
diff options
context:
space:
mode:
Diffstat (limited to 'tests/unittests')
-rw-r--r--tests/unittests/test_util.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/tests/unittests/test_util.py b/tests/unittests/test_util.py
index 787ca208..d63b760e 100644
--- a/tests/unittests/test_util.py
+++ b/tests/unittests/test_util.py
@@ -299,6 +299,14 @@ class TestLoadYaml(helpers.TestCase):
default=self.mydefault),
myobj)
+ def test_none_returns_default(self):
+ """If yaml.load returns None, then default should be returned."""
+ blobs = ("", " ", "# foo\n", "#")
+ mdef = self.mydefault
+ self.assertEqual(
+ [(b, self.mydefault) for b in blobs],
+ [(b, util.load_yaml(blob=b, default=mdef)) for b in blobs])
+
class TestMountinfoParsing(helpers.ResourceUsingTestCase):
def test_invalid_mountinfo(self):