summaryrefslogtreecommitdiff
path: root/yarnhelper_tests.py
diff options
context:
space:
mode:
authorLars Wirzenius <liw@liw.fi>2017-03-18 19:42:28 +0200
committerLars Wirzenius <liw@liw.fi>2017-03-18 19:42:28 +0200
commit8f2cf6cd84f54a1db8bdd51c93253cd8e41d6d9d (patch)
treeb1e626ed3f1369f90ed93ecd88b417e3bff06d38 /yarnhelper_tests.py
parentfc757194e1c4e2596678ba8d3b5269280fa12b40 (diff)
downloadserver-yarns-8f2cf6cd84f54a1db8bdd51c93253cd8e41d6d9d.tar.gz
Add default value to .get; fix vars.yaml location
Diffstat (limited to 'yarnhelper_tests.py')
-rw-r--r--yarnhelper_tests.py7
1 files changed, 2 insertions, 5 deletions
diff --git a/yarnhelper_tests.py b/yarnhelper_tests.py
index 756a165..858bcdc 100644
--- a/yarnhelper_tests.py
+++ b/yarnhelper_tests.py
@@ -66,12 +66,9 @@ class PersistentVariableTests(unittest.TestCase):
if os.path.exists(yarnhelper.variables_filename):
os.remove(yarnhelper.variables_filename)
- def test_raises_error_if_no_such_variable(self):
+ def test_returns_default_if_no_such_variable(self):
h = yarnhelper.YarnHelper()
- with self.assertRaises(yarnhelper.Error):
- h.get_variable('FOO')
- print
- print 'variables:', h._variables
+ self.assertEqual(h.get_variable('foo', default=42), 42)
def test_sets_variable_persistently(self):
h = yarnhelper.YarnHelper()