mirror of
https://github.com/tbabej/taskwiki.git
synced 2025-08-19 06:43:06 +02:00
62 lines
1.3 KiB
Python
62 lines
1.3 KiB
Python
from tests.base import IntegrationTest
|
|
|
|
|
|
class TestViewportsTaskGeneration(IntegrationTest):
|
|
|
|
viminput = """
|
|
=== Work tasks | +work ===
|
|
"""
|
|
|
|
vimoutput = """
|
|
=== Work tasks | +work ===
|
|
* [ ] tag work task #{uuid}
|
|
"""
|
|
|
|
tasks = [
|
|
dict(description="tag work task", tags=['work']),
|
|
]
|
|
|
|
def execute(self):
|
|
self.command("w", regex="written$", lines=1)
|
|
|
|
|
|
class TestViewportsTaskRemoval(IntegrationTest):
|
|
|
|
viminput = """
|
|
=== Work tasks | -work ===
|
|
* [ ] tag work task #{uuid}
|
|
"""
|
|
|
|
vimoutput = """
|
|
=== Work tasks | -work ===
|
|
"""
|
|
|
|
tasks = [
|
|
dict(description="tag work task", tags=['work']),
|
|
]
|
|
|
|
def execute(self):
|
|
self.command("w", regex="written$", lines=1)
|
|
|
|
|
|
class TestViewportDefaultsAssigment(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']
|
|
|