mirror of
https://github.com/tbabej/taskwiki.git
synced 2025-08-18 21:33:07 +02:00
Adds count viewport setting
This commit is contained in:
parent
72397a8c23
commit
a3ae9c52cd
5 changed files with 115 additions and 39 deletions
|
@ -545,6 +545,30 @@ class TestViewportsSortedInvalidOrder(MultiSyntaxIntegrationTest):
|
|||
"'Work tasks' is not defined, using default.", lines=2)
|
||||
|
||||
|
||||
class TestViewportsCount(MultiSyntaxIntegrationTest):
|
||||
|
||||
viminput = """
|
||||
HEADER2(Work tasks | project:Work or project:Home limit:2)
|
||||
"""
|
||||
|
||||
vimoutput = """
|
||||
HEADER2(Work tasks | project:Work or project:Home limit:2)
|
||||
* [ ] home task 1 (2015-08-01) #{uuid}
|
||||
* [ ] work task 1 (2015-08-01) #{uuid}
|
||||
"""
|
||||
|
||||
tasks = [
|
||||
dict(description="home task 1", project="Home", due=datetime(2015,8,1)),
|
||||
dict(description="home task 2", project="Home", due=datetime(2015,8,2)),
|
||||
dict(description="work task 1", project="Work", due=datetime(2015,8,1)),
|
||||
dict(description="work task 2", project="Work", due=datetime(2015,8,2)),
|
||||
]
|
||||
|
||||
def execute(self):
|
||||
# Generate the tasks
|
||||
self.command("w", regex="written$", lines=1)
|
||||
|
||||
|
||||
class TestViewportsVisibleMetaTag(MultiSyntaxIntegrationTest):
|
||||
|
||||
viminput = """
|
||||
|
|
|
@ -112,6 +112,14 @@ class TestParsingVimwikiTask(object):
|
|||
assert port.sort == 'extra'
|
||||
assert port.tw == 'extra'
|
||||
|
||||
def test_count(self, test_syntax):
|
||||
example_viewport = "HEADER2(Test | project:Home limit:2)"
|
||||
port = self.process_viewport(example_viewport, test_syntax)
|
||||
|
||||
assert port.taskfilter == list(DEFAULT_VIEWPORT_VIRTUAL_TAGS) + ["(", "project:Home", ")"]
|
||||
assert port.name == "Test"
|
||||
assert port.count == 2
|
||||
|
||||
def test_override_default_virtual_tags_neutral(self, test_syntax):
|
||||
example_viewport = "HEADER2(Test | project:Home !?DELETED)"
|
||||
port = self.process_viewport(example_viewport, test_syntax)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue