mirror of
https://github.com/tbabej/taskwiki.git
synced 2025-08-19 06:43:06 +02:00
tests: Add test for viewport defaults
This commit is contained in:
parent
c91a009c6d
commit
63b66ed79a
1 changed files with 27 additions and 2 deletions
|
@ -158,6 +158,28 @@ class TestViewports(IntegrationTest):
|
|||
self.command("w", regex="written$", lines=1)
|
||||
|
||||
|
||||
class TestViewportDefaults(IntegrationTest):
|
||||
|
||||
viminput = """
|
||||
=== Work tasks | +work ===
|
||||
* [ ] tag work task
|
||||
"""
|
||||
|
||||
vimoutput = """
|
||||
=== Work tasks | +work ===
|
||||
* [ ] tag work task #{uuid}
|
||||
"""
|
||||
|
||||
def execute(self):
|
||||
self.command("w", regex="written$", lines=1)
|
||||
assert len(self.tw.tasks.pending()) == 1
|
||||
|
||||
task = self.tw.tasks.pending()[0]
|
||||
assert task['description'] == 'tag work task'
|
||||
assert task['status'] == 'pending'
|
||||
assert task['tags'] == ['work']
|
||||
|
||||
|
||||
class TestSimpleTask(IntegrationTest):
|
||||
|
||||
viminput = """
|
||||
|
@ -172,5 +194,8 @@ class TestSimpleTask(IntegrationTest):
|
|||
self.command("w", regex="written$", lines=1)
|
||||
|
||||
# Check that only one tasks with this description exists
|
||||
matching = self.tw.tasks.filter(description="This is a test task")
|
||||
assert len(matching) == 1
|
||||
assert len(self.tw.tasks.pending()) == 1
|
||||
|
||||
task = self.tw.tasks.pending()[0]
|
||||
assert task['description'] == 'This is a test task'
|
||||
assert task['status'] == 'pending'
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue