From 34d5a07d908d2c5cc39f76a7e14de0725f669b2e Mon Sep 17 00:00:00 2001 From: Paul Beckingham Date: Wed, 28 Oct 2015 17:37:08 -0400 Subject: [PATCH] Test: Added context tests - Added 'input="y\n"' to a test that was otherwise timing out. - Added multi-word context test. --- test/context.t | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/test/context.t b/test/context.t index 5dbfc57e1..a55ab1af0 100755 --- a/test/context.t +++ b/test/context.t @@ -47,7 +47,7 @@ class ContextManagementTest(TestCase): """With confirmation active, prompt if context filter matches no tasks""" self.t.config("confirmation", "on") - code, out, err = self.t.runError('context define work project:Work') + code, out, err = self.t.runError('context define work project:Work', input="y\n") self.assertIn("The filter 'project:Work' matches 0 pending tasks.", out) self.assertNotIn("Context 'work' defined.", out) @@ -56,7 +56,7 @@ class ContextManagementTest(TestCase): def test_context_define(self): """Test simple context definition.""" - code, out, err = self.t('context define work project:Work') + code, out, err = self.t('context define work project:Work', input="y\n") self.assertIn("Context 'work' defined.", out) # Assert the config contains context definition @@ -506,6 +506,11 @@ class ContextErrorHandling(TestCase): code, out, err = self.t.runError("context missing") self.assertIn("Context 'missing' not found.", err) + def test_set_multi(self): + """Verify 'task context one\\ two' with no contexts yields error""" + code, out, err = self.t.runError("context one\\ two") + self.assertIn("Context 'one two' not found.", err) + def test_show_missing(self): """Verify 'task context show' with no contexts yields error""" code, out, err = self.t("context show")