mirror of
https://github.com/tbabej/taskwiki.git
synced 2025-08-24 05:36:41 +02:00
tests: Add test for viewport being terminated by a header
This commit is contained in:
parent
0f50979a42
commit
7ca18a4137
1 changed files with 33 additions and 0 deletions
|
@ -194,6 +194,39 @@ class TestViewportDefaultsExplicitEmpty(IntegrationTest):
|
||||||
assert task['tags'] == set()
|
assert task['tags'] == set()
|
||||||
|
|
||||||
|
|
||||||
|
class TestViewportDefaultsTerminatedByHeader(IntegrationTest):
|
||||||
|
|
||||||
|
viminput = """
|
||||||
|
=== Work tasks | +work ===
|
||||||
|
* [ ] tag work task
|
||||||
|
|
||||||
|
=== Unrelated work tasks ===
|
||||||
|
* [ ] not tagged work task
|
||||||
|
"""
|
||||||
|
|
||||||
|
vimoutput = """
|
||||||
|
=== Work tasks | +work ===
|
||||||
|
* [ ] tag work task #{uuid}
|
||||||
|
|
||||||
|
=== Unrelated work tasks ===
|
||||||
|
* [ ] not tagged work task #{uuid}
|
||||||
|
"""
|
||||||
|
|
||||||
|
def execute(self):
|
||||||
|
self.command("w", regex="written$", lines=1)
|
||||||
|
assert len(self.tw.tasks.pending()) == 2
|
||||||
|
|
||||||
|
task = self.tw.tasks.filter('+work')[0]
|
||||||
|
assert task['description'] == 'tag work task'
|
||||||
|
assert task['status'] == 'pending'
|
||||||
|
assert task['tags'] == set(['work'])
|
||||||
|
|
||||||
|
task = self.tw.tasks.filter('-work')[0]
|
||||||
|
assert task['description'] == 'not tagged work task'
|
||||||
|
assert task['status'] == 'pending'
|
||||||
|
assert task['tags'] == set()
|
||||||
|
|
||||||
|
|
||||||
class TestViewportInspection(IntegrationTest):
|
class TestViewportInspection(IntegrationTest):
|
||||||
|
|
||||||
viminput = """
|
viminput = """
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue