mirror of
https://github.com/GothenburgBitFactory/taskwarrior.git
synced 2025-08-19 09:53:08 +02:00
Test: Added context tests
- Added 'input="y\n"' to a test that was otherwise timing out. - Added multi-word context test.
This commit is contained in:
parent
acb83130fa
commit
34d5a07d90
1 changed files with 7 additions and 2 deletions
|
@ -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")
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue