mirror of
https://github.com/tbabej/taskwiki.git
synced 2025-08-24 05:36:41 +02:00
Implemented multIi-markup tests in vim of viewport and preset
This commit is contained in:
parent
159d5c4b79
commit
8d8fd2c20b
3 changed files with 176 additions and 127 deletions
|
@ -19,6 +19,7 @@ class IntegrationTest(object):
|
||||||
viminput = None
|
viminput = None
|
||||||
vimoutput = None
|
vimoutput = None
|
||||||
tasks = []
|
tasks = []
|
||||||
|
markup = None
|
||||||
|
|
||||||
def add_plugin(self, name):
|
def add_plugin(self, name):
|
||||||
plugin_base = os.path.expanduser('~/.vim/bundle/')
|
plugin_base = os.path.expanduser('~/.vim/bundle/')
|
||||||
|
@ -71,6 +72,7 @@ class IntegrationTest(object):
|
||||||
self.command('let g:taskwiki_taskrc_location="{0}"'.format(self.taskrc_path))
|
self.command('let g:taskwiki_taskrc_location="{0}"'.format(self.taskrc_path))
|
||||||
self.command("let g:vimwiki_list = [{'syntax': 'mediawiki', 'ext': '.txt','path': '%s'}]" % self.dir)
|
self.command("let g:vimwiki_list = [{'syntax': 'mediawiki', 'ext': '.txt','path': '%s'}]" % self.dir)
|
||||||
self.command('let g:taskwiki_measure_coverage="yes"')
|
self.command('let g:taskwiki_measure_coverage="yes"')
|
||||||
|
self.command('let g:taskwiki_markup_syntax="{0}"'.format(self.markup))
|
||||||
|
|
||||||
def setup(self):
|
def setup(self):
|
||||||
self.generate_data()
|
self.generate_data()
|
||||||
|
@ -198,6 +200,7 @@ class IntegrationTest(object):
|
||||||
def test_execute(self):
|
def test_execute(self):
|
||||||
# First, run sanity checks
|
# First, run sanity checks
|
||||||
success = False
|
success = False
|
||||||
|
self.markup = 'default'
|
||||||
|
|
||||||
for i in range(5):
|
for i in range(5):
|
||||||
if self.check_sanity(soft=True):
|
if self.check_sanity(soft=True):
|
||||||
|
@ -229,6 +232,51 @@ class IntegrationTest(object):
|
||||||
assert self.read_buffer() == lines
|
assert self.read_buffer() == lines
|
||||||
|
|
||||||
|
|
||||||
|
class MultiSyntaxIntegrationTest(IntegrationTest):
|
||||||
|
|
||||||
|
|
||||||
|
def test_execute(self, test_syntax):
|
||||||
|
|
||||||
|
# Set markup syntax
|
||||||
|
markup, header_expand = test_syntax
|
||||||
|
self.markup = markup
|
||||||
|
|
||||||
|
# First, run sanity checks
|
||||||
|
success = False
|
||||||
|
|
||||||
|
for i in range(5):
|
||||||
|
if self.check_sanity(soft=True):
|
||||||
|
success = True
|
||||||
|
break
|
||||||
|
else:
|
||||||
|
self.teardown()
|
||||||
|
self.setup()
|
||||||
|
|
||||||
|
if not success:
|
||||||
|
self.check_sanity(soft=False)
|
||||||
|
|
||||||
|
# Then load the input
|
||||||
|
if self.viminput:
|
||||||
|
# Expand HEADER
|
||||||
|
self.viminput = header_expand(self.viminput)
|
||||||
|
# Unindent the lines
|
||||||
|
lines = [self.fill_uuid(l[4:])
|
||||||
|
for l in self.viminput.strip('\n').splitlines()]
|
||||||
|
self.write_buffer(lines)
|
||||||
|
|
||||||
|
# Do the stuff
|
||||||
|
self.execute()
|
||||||
|
|
||||||
|
# Check expected output
|
||||||
|
if self.vimoutput:
|
||||||
|
self.vimoutput = header_expand(self.vimoutput)
|
||||||
|
lines = [
|
||||||
|
self.fill_uuid(l[4:])
|
||||||
|
for l in self.vimoutput.strip('\n').splitlines()[:-1]
|
||||||
|
]
|
||||||
|
assert self.read_buffer() == lines
|
||||||
|
|
||||||
|
|
||||||
class MultipleSourceTest(IntegrationTest):
|
class MultipleSourceTest(IntegrationTest):
|
||||||
|
|
||||||
extra_tasks = []
|
extra_tasks = []
|
||||||
|
@ -347,6 +395,7 @@ class MockCache(object):
|
||||||
self.vwtask = dict()
|
self.vwtask = dict()
|
||||||
self.task = dict()
|
self.task = dict()
|
||||||
self.viewport = dict()
|
self.viewport = dict()
|
||||||
|
self.markup_syntax = 'default'
|
||||||
|
|
||||||
def reset(self):
|
def reset(self):
|
||||||
self.warriors.clear()
|
self.warriors.clear()
|
||||||
|
|
|
@ -1,16 +1,16 @@
|
||||||
from tests.base import IntegrationTest
|
from tests.base import MultiSyntaxIntegrationTest
|
||||||
from time import sleep
|
from time import sleep
|
||||||
|
|
||||||
|
|
||||||
class TestPresetDefaults(IntegrationTest):
|
class TestPresetDefaults(MultiSyntaxIntegrationTest):
|
||||||
|
|
||||||
viminput = """
|
viminput = """
|
||||||
=== Work tasks || +work ===
|
HEADER3(Work tasks || +work)
|
||||||
* [ ] This is a test task
|
* [ ] This is a test task
|
||||||
"""
|
"""
|
||||||
|
|
||||||
vimoutput = """
|
vimoutput = """
|
||||||
=== Work tasks || +work ===
|
HEADER3(Work tasks || +work)
|
||||||
* [ ] This is a test task #{uuid}
|
* [ ] This is a test task #{uuid}
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
@ -24,19 +24,19 @@ class TestPresetDefaults(IntegrationTest):
|
||||||
assert task['tags'] == set(['work'])
|
assert task['tags'] == set(['work'])
|
||||||
|
|
||||||
|
|
||||||
class TestPresetHierarchy(IntegrationTest):
|
class TestPresetHierarchy(MultiSyntaxIntegrationTest):
|
||||||
|
|
||||||
viminput = """
|
viminput = """
|
||||||
== Work tasks || +work ==
|
HEADER2(Work tasks || +work)
|
||||||
=== Hard work tasks || +hard ===
|
HEADER3(Hard work tasks || +hard)
|
||||||
=== Easy work tasks || +easy ===
|
HEADER3(Easy work tasks || +easy)
|
||||||
* [ ] This is a test task
|
* [ ] This is a test task
|
||||||
"""
|
"""
|
||||||
|
|
||||||
vimoutput = """
|
vimoutput = """
|
||||||
== Work tasks || +work ==
|
HEADER2(Work tasks || +work)
|
||||||
=== Hard work tasks || +hard ===
|
HEADER3(Hard work tasks || +hard)
|
||||||
=== Easy work tasks || +easy ===
|
HEADER3(Easy work tasks || +easy)
|
||||||
* [ ] This is a test task #{uuid}
|
* [ ] This is a test task #{uuid}
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
@ -50,15 +50,15 @@ class TestPresetHierarchy(IntegrationTest):
|
||||||
assert task['tags'] == set(['work', 'easy'])
|
assert task['tags'] == set(['work', 'easy'])
|
||||||
|
|
||||||
|
|
||||||
class TestPresetSeparateDefaults(IntegrationTest):
|
class TestPresetSeparateDefaults(MultiSyntaxIntegrationTest):
|
||||||
|
|
||||||
viminput = """
|
viminput = """
|
||||||
= Work tasks || +work or +play || +work =
|
HEADER1(Work tasks || +work or +play || +work)
|
||||||
* [ ] This is a test task
|
* [ ] This is a test task
|
||||||
"""
|
"""
|
||||||
|
|
||||||
vimoutput = """
|
vimoutput = """
|
||||||
= Work tasks || +work or +play || +work =
|
HEADER1(Work tasks || +work or +play || +work)
|
||||||
* [ ] This is a test task #{uuid}
|
* [ ] This is a test task #{uuid}
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
@ -72,17 +72,17 @@ class TestPresetSeparateDefaults(IntegrationTest):
|
||||||
assert task['tags'] == set(['work'])
|
assert task['tags'] == set(['work'])
|
||||||
|
|
||||||
|
|
||||||
class TestPresetNestedDefaults(IntegrationTest):
|
class TestPresetNestedDefaults(MultiSyntaxIntegrationTest):
|
||||||
|
|
||||||
viminput = """
|
viminput = """
|
||||||
== Work tasks || +work ==
|
HEADER2(Work tasks || +work)
|
||||||
=== Hard work || +hard ===
|
HEADER3(Hard work || +hard)
|
||||||
* [ ] This is a test task
|
* [ ] This is a test task
|
||||||
"""
|
"""
|
||||||
|
|
||||||
vimoutput = """
|
vimoutput = """
|
||||||
== Work tasks || +work ==
|
HEADER2(Work tasks || +work)
|
||||||
=== Hard work || +hard ===
|
HEADER3(Hard work || +hard)
|
||||||
* [ ] This is a test task #{uuid}
|
* [ ] This is a test task #{uuid}
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
@ -96,16 +96,16 @@ class TestPresetNestedDefaults(IntegrationTest):
|
||||||
assert task['tags'] == set(['work', 'hard'])
|
assert task['tags'] == set(['work', 'hard'])
|
||||||
|
|
||||||
|
|
||||||
class TestPresetViewport(IntegrationTest):
|
class TestPresetViewport(MultiSyntaxIntegrationTest):
|
||||||
|
|
||||||
viminput = """
|
viminput = """
|
||||||
== Work tasks || +work ==
|
HEADER2(Work tasks || +work)
|
||||||
=== Hard work | +hard ===
|
HEADER3(Hard work | +hard)
|
||||||
"""
|
"""
|
||||||
|
|
||||||
vimoutput = """
|
vimoutput = """
|
||||||
== Work tasks || +work ==
|
HEADER2(Work tasks || +work)
|
||||||
=== Hard work | +hard ===
|
HEADER3(Hard work | +hard)
|
||||||
* [ ] tag hard work task #{uuid}
|
* [ ] tag hard work task #{uuid}
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
@ -120,17 +120,17 @@ class TestPresetViewport(IntegrationTest):
|
||||||
self.command("w", regex="written$", lines=1)
|
self.command("w", regex="written$", lines=1)
|
||||||
|
|
||||||
|
|
||||||
class TestPresetIgnoreViewport(IntegrationTest):
|
class TestPresetIgnoreViewport(MultiSyntaxIntegrationTest):
|
||||||
|
|
||||||
viminput = """
|
viminput = """
|
||||||
== Work tasks | +work ==
|
HEADER2(Work tasks | +work)
|
||||||
=== Hard work || +hard ===
|
HEADER3(Hard work || +hard)
|
||||||
* [ ] This is a test task
|
* [ ] This is a test task
|
||||||
"""
|
"""
|
||||||
|
|
||||||
vimoutput = """
|
vimoutput = """
|
||||||
== Work tasks | +work ==
|
HEADER2(Work tasks | +work)
|
||||||
=== Hard work || +hard ===
|
HEADER3(Hard work || +hard)
|
||||||
* [ ] This is a test task #{uuid}
|
* [ ] This is a test task #{uuid}
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
@ -144,17 +144,17 @@ class TestPresetIgnoreViewport(IntegrationTest):
|
||||||
assert task['tags'] == set(['hard'])
|
assert task['tags'] == set(['hard'])
|
||||||
|
|
||||||
|
|
||||||
class TestPresetViewportDefaultsYesNo(IntegrationTest):
|
class TestPresetViewportDefaultsYesNo(MultiSyntaxIntegrationTest):
|
||||||
|
|
||||||
viminput = """
|
viminput = """
|
||||||
== Work tasks || project:Work or project:Play || project:Work ==
|
HEADER2(Work tasks || project:Work or project:Play || project:Work)
|
||||||
=== Hard work | +hard ===
|
HEADER3(Hard work | +hard)
|
||||||
* [ ] This is a test task
|
* [ ] This is a test task
|
||||||
"""
|
"""
|
||||||
|
|
||||||
vimoutput = """
|
vimoutput = """
|
||||||
== Work tasks || project:Work or project:Play || project:Work ==
|
HEADER2(Work tasks || project:Work or project:Play || project:Work)
|
||||||
=== Hard work | +hard ===
|
HEADER3(Hard work | +hard)
|
||||||
* [ ] This is a test task #{uuid}
|
* [ ] This is a test task #{uuid}
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
@ -169,17 +169,17 @@ class TestPresetViewportDefaultsYesNo(IntegrationTest):
|
||||||
assert task['project'] == 'Work'
|
assert task['project'] == 'Work'
|
||||||
|
|
||||||
|
|
||||||
class TestPresetViewportDefaultsNoYes(IntegrationTest):
|
class TestPresetViewportDefaultsNoYes(MultiSyntaxIntegrationTest):
|
||||||
|
|
||||||
viminput = """
|
viminput = """
|
||||||
== Work tasks || project:Work ==
|
HEADER2(Work tasks || project:Work)
|
||||||
=== Hard work | +hard or +easy | +hard ===
|
HEADER3(Hard work | +hard or +easy | +hard)
|
||||||
* [ ] This is a test task
|
* [ ] This is a test task
|
||||||
"""
|
"""
|
||||||
|
|
||||||
vimoutput = """
|
vimoutput = """
|
||||||
== Work tasks || project:Work ==
|
HEADER2(Work tasks || project:Work)
|
||||||
=== Hard work | +hard or +easy | +hard ===
|
HEADER3(Hard work | +hard or +easy | +hard)
|
||||||
* [ ] This is a test task #{uuid}
|
* [ ] This is a test task #{uuid}
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
@ -194,17 +194,17 @@ class TestPresetViewportDefaultsNoYes(IntegrationTest):
|
||||||
assert task['project'] == 'Work'
|
assert task['project'] == 'Work'
|
||||||
|
|
||||||
|
|
||||||
class TestPresetViewportDefaultsYesYes(IntegrationTest):
|
class TestPresetViewportDefaultsYesYes(MultiSyntaxIntegrationTest):
|
||||||
|
|
||||||
viminput = """
|
viminput = """
|
||||||
== Work tasks || project:Work or project:Play || project:Work ==
|
HEADER2(Work tasks || project:Work or project:Play || project:Work)
|
||||||
=== Hard work | +hard or +easy | +hard ===
|
HEADER3(Hard work | +hard or +easy | +hard)
|
||||||
* [ ] This is a test task
|
* [ ] This is a test task
|
||||||
"""
|
"""
|
||||||
|
|
||||||
vimoutput = """
|
vimoutput = """
|
||||||
== Work tasks || project:Work or project:Play || project:Work ==
|
HEADER2(Work tasks || project:Work or project:Play || project:Work)
|
||||||
=== Hard work | +hard or +easy | +hard ===
|
HEADER3(Hard work | +hard or +easy | +hard)
|
||||||
* [ ] This is a test task #{uuid}
|
* [ ] This is a test task #{uuid}
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
@ -219,17 +219,17 @@ class TestPresetViewportDefaultsYesYes(IntegrationTest):
|
||||||
assert task['project'] == 'Work'
|
assert task['project'] == 'Work'
|
||||||
|
|
||||||
|
|
||||||
class TestPresetDefaultPreservesTags(IntegrationTest):
|
class TestPresetDefaultPreservesTags(MultiSyntaxIntegrationTest):
|
||||||
|
|
||||||
viminput = """
|
viminput = """
|
||||||
== Work tasks || +work ==
|
HEADER2(Work tasks || +work)
|
||||||
=== Work tasks | +hard ===
|
HEADER3(Work tasks | +hard)
|
||||||
* [ ] hard task
|
* [ ] hard task
|
||||||
"""
|
"""
|
||||||
|
|
||||||
vimoutput = """
|
vimoutput = """
|
||||||
== Work tasks || +work ==
|
HEADER2(Work tasks || +work)
|
||||||
=== Work tasks | +hard ===
|
HEADER3(Work tasks | +hard)
|
||||||
* [ ] hard task #{uuid}
|
* [ ] hard task #{uuid}
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
|
|
@ -1,17 +1,17 @@
|
||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
from datetime import datetime
|
from datetime import datetime
|
||||||
from tests.base import IntegrationTest
|
from tests.base import MultiSyntaxIntegrationTest
|
||||||
from time import sleep
|
from time import sleep
|
||||||
|
|
||||||
|
|
||||||
class TestViewportsTaskGeneration(IntegrationTest):
|
class TestViewportsTaskGeneration(MultiSyntaxIntegrationTest):
|
||||||
|
|
||||||
viminput = """
|
viminput = """
|
||||||
=== Work tasks | +work ===
|
HEADER2(Work tasks | +work)
|
||||||
"""
|
"""
|
||||||
|
|
||||||
vimoutput = """
|
vimoutput = """
|
||||||
=== Work tasks | +work ===
|
HEADER2(Work tasks | +work)
|
||||||
* [ ] tag work task #{uuid}
|
* [ ] tag work task #{uuid}
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
@ -23,14 +23,14 @@ class TestViewportsTaskGeneration(IntegrationTest):
|
||||||
self.command("w", regex="written$", lines=1)
|
self.command("w", regex="written$", lines=1)
|
||||||
|
|
||||||
|
|
||||||
class TestViewportsTaskGenerationEmptyFilter(IntegrationTest):
|
class TestViewportsTaskGenerationEmptyFilter(MultiSyntaxIntegrationTest):
|
||||||
|
|
||||||
viminput = """
|
viminput = """
|
||||||
=== Work tasks | ===
|
HEADER2(Work tasks |)
|
||||||
"""
|
"""
|
||||||
|
|
||||||
vimoutput = """
|
vimoutput = """
|
||||||
=== Work tasks | ===
|
HEADER2(Work tasks |)
|
||||||
* [ ] some task #{uuid}
|
* [ ] some task #{uuid}
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
@ -42,15 +42,15 @@ class TestViewportsTaskGenerationEmptyFilter(IntegrationTest):
|
||||||
self.command("w", regex="written$", lines=1)
|
self.command("w", regex="written$", lines=1)
|
||||||
|
|
||||||
|
|
||||||
class TestViewportsTaskRemoval(IntegrationTest):
|
class TestViewportsTaskRemoval(MultiSyntaxIntegrationTest):
|
||||||
|
|
||||||
viminput = """
|
viminput = """
|
||||||
=== Work tasks | -work ===
|
HEADER2(Work tasks | -work)
|
||||||
* [ ] tag work task #{uuid}
|
* [ ] tag work task #{uuid}
|
||||||
"""
|
"""
|
||||||
|
|
||||||
vimoutput = """
|
vimoutput = """
|
||||||
=== Work tasks | -work ===
|
HEADER2(Work tasks | -work)
|
||||||
"""
|
"""
|
||||||
|
|
||||||
tasks = [
|
tasks = [
|
||||||
|
@ -61,14 +61,14 @@ class TestViewportsTaskRemoval(IntegrationTest):
|
||||||
self.command("w", regex="written$", lines=1)
|
self.command("w", regex="written$", lines=1)
|
||||||
|
|
||||||
|
|
||||||
class TestViewportsContextTaskGeneration(IntegrationTest):
|
class TestViewportsContextTaskGeneration(MultiSyntaxIntegrationTest):
|
||||||
|
|
||||||
viminput = """
|
viminput = """
|
||||||
=== Work tasks | @work ===
|
HEADER2(Work tasks | @work)
|
||||||
"""
|
"""
|
||||||
|
|
||||||
vimoutput = """
|
vimoutput = """
|
||||||
=== Work tasks | @work ===
|
HEADER2(Work tasks | @work)
|
||||||
* [ ] tag work task #{uuid}
|
* [ ] tag work task #{uuid}
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
@ -83,14 +83,14 @@ class TestViewportsContextTaskGeneration(IntegrationTest):
|
||||||
self.command("w", regex="written$", lines=1)
|
self.command("w", regex="written$", lines=1)
|
||||||
|
|
||||||
|
|
||||||
class TestViewportsContextComplexFilterTaskGeneration(IntegrationTest):
|
class TestViewportsContextComplexFilterTaskGeneration(MultiSyntaxIntegrationTest):
|
||||||
|
|
||||||
viminput = """
|
viminput = """
|
||||||
=== Work tasks | @work or project:Home ===
|
HEADER2(Work tasks | @work or project:Home)
|
||||||
"""
|
"""
|
||||||
|
|
||||||
vimoutput = """
|
vimoutput = """
|
||||||
=== Work tasks | @work or project:Home ===
|
HEADER2(Work tasks | @work or project:Home)
|
||||||
* [ ] home project task #{uuid}
|
* [ ] home project task #{uuid}
|
||||||
* [ ] tag work task #{uuid}
|
* [ ] tag work task #{uuid}
|
||||||
"""
|
"""
|
||||||
|
@ -107,14 +107,14 @@ class TestViewportsContextComplexFilterTaskGeneration(IntegrationTest):
|
||||||
self.command("w", regex="written$", lines=1)
|
self.command("w", regex="written$", lines=1)
|
||||||
|
|
||||||
|
|
||||||
class TestViewportsTwoContextTaskGeneration(IntegrationTest):
|
class TestViewportsTwoContextTaskGeneration(MultiSyntaxIntegrationTest):
|
||||||
|
|
||||||
viminput = """
|
viminput = """
|
||||||
=== Work tasks | @work or @home ===
|
HEADER2(Work tasks | @work or @home)
|
||||||
"""
|
"""
|
||||||
|
|
||||||
vimoutput = """
|
vimoutput = """
|
||||||
=== Work tasks | @work or @home ===
|
HEADER2(Work tasks | @work or @home)
|
||||||
* [ ] home project task #{uuid}
|
* [ ] home project task #{uuid}
|
||||||
* [ ] tag work task #{uuid}
|
* [ ] tag work task #{uuid}
|
||||||
"""
|
"""
|
||||||
|
@ -132,14 +132,14 @@ class TestViewportsTwoContextTaskGeneration(IntegrationTest):
|
||||||
self.command("w", regex="written$", lines=1)
|
self.command("w", regex="written$", lines=1)
|
||||||
|
|
||||||
|
|
||||||
class TestViewportsContextInvalid(IntegrationTest):
|
class TestViewportsContextInvalid(MultiSyntaxIntegrationTest):
|
||||||
|
|
||||||
viminput = """
|
viminput = """
|
||||||
=== Work tasks | @doesnotexist ===
|
HEADER2(Work tasks | @doesnotexist)
|
||||||
"""
|
"""
|
||||||
|
|
||||||
vimoutput = """
|
vimoutput = """
|
||||||
=== Work tasks | @doesnotexist ===
|
HEADER2(Work tasks | @doesnotexist)
|
||||||
"""
|
"""
|
||||||
|
|
||||||
def execute(self):
|
def execute(self):
|
||||||
|
@ -147,15 +147,15 @@ class TestViewportsContextInvalid(IntegrationTest):
|
||||||
"could not be found.", lines=3)
|
"could not be found.", lines=3)
|
||||||
|
|
||||||
|
|
||||||
class TestViewportDefaultsAssigment(IntegrationTest):
|
class TestViewportDefaultsAssigment(MultiSyntaxIntegrationTest):
|
||||||
|
|
||||||
viminput = """
|
viminput = """
|
||||||
=== Work tasks | +work ===
|
HEADER2(Work tasks | +work)
|
||||||
* [ ] tag work task
|
* [ ] tag work task
|
||||||
"""
|
"""
|
||||||
|
|
||||||
vimoutput = """
|
vimoutput = """
|
||||||
=== Work tasks | +work ===
|
HEADER2(Work tasks | +work)
|
||||||
* [ ] tag work task #{uuid}
|
* [ ] tag work task #{uuid}
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
@ -169,15 +169,15 @@ class TestViewportDefaultsAssigment(IntegrationTest):
|
||||||
assert task['tags'] == set(['work'])
|
assert task['tags'] == set(['work'])
|
||||||
|
|
||||||
|
|
||||||
class TestViewportDefaultsExplicit(IntegrationTest):
|
class TestViewportDefaultsExplicit(MultiSyntaxIntegrationTest):
|
||||||
|
|
||||||
viminput = """
|
viminput = """
|
||||||
=== Work tasks | project:Home +home | project:Chores ===
|
HEADER2(Work tasks | project:Home +home | project:Chores)
|
||||||
* [ ] home task
|
* [ ] home task
|
||||||
"""
|
"""
|
||||||
|
|
||||||
vimoutput = """
|
vimoutput = """
|
||||||
=== Work tasks | project:Home +home | project:Chores ===
|
HEADER2(Work tasks | project:Home +home | project:Chores)
|
||||||
"""
|
"""
|
||||||
|
|
||||||
def execute(self):
|
def execute(self):
|
||||||
|
@ -191,15 +191,15 @@ class TestViewportDefaultsExplicit(IntegrationTest):
|
||||||
assert task['tags'] == set()
|
assert task['tags'] == set()
|
||||||
|
|
||||||
|
|
||||||
class TestViewportDefaultsExplicitEmpty(IntegrationTest):
|
class TestViewportDefaultsExplicitEmpty(MultiSyntaxIntegrationTest):
|
||||||
|
|
||||||
viminput = """
|
viminput = """
|
||||||
=== Work tasks | project:Home +home | project: ===
|
HEADER2(Work tasks | project:Home +home | project:)
|
||||||
* [ ] home task
|
* [ ] home task
|
||||||
"""
|
"""
|
||||||
|
|
||||||
vimoutput = """
|
vimoutput = """
|
||||||
=== Work tasks | project:Home +home | project: ===
|
HEADER2(Work tasks | project:Home +home | project:)
|
||||||
"""
|
"""
|
||||||
|
|
||||||
def execute(self):
|
def execute(self):
|
||||||
|
@ -213,21 +213,21 @@ class TestViewportDefaultsExplicitEmpty(IntegrationTest):
|
||||||
assert task['tags'] == set()
|
assert task['tags'] == set()
|
||||||
|
|
||||||
|
|
||||||
class TestViewportDefaultsTerminatedByHeader(IntegrationTest):
|
class TestViewportDefaultsTerminatedByHeader(MultiSyntaxIntegrationTest):
|
||||||
|
|
||||||
viminput = """
|
viminput = """
|
||||||
=== Work tasks | +work ===
|
HEADER2(Work tasks | +work)
|
||||||
* [ ] tag work task
|
* [ ] tag work task
|
||||||
|
|
||||||
=== Unrelated work tasks ===
|
HEADER2(Unrelated work tasks)
|
||||||
* [ ] not tagged work task
|
* [ ] not tagged work task
|
||||||
"""
|
"""
|
||||||
|
|
||||||
vimoutput = """
|
vimoutput = """
|
||||||
=== Work tasks | +work ===
|
HEADER2(Work tasks | +work)
|
||||||
* [ ] tag work task #{uuid}
|
* [ ] tag work task #{uuid}
|
||||||
|
|
||||||
=== Unrelated work tasks ===
|
HEADER2(Unrelated work tasks)
|
||||||
* [ ] not tagged work task #{uuid}
|
* [ ] not tagged work task #{uuid}
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
@ -246,10 +246,10 @@ class TestViewportDefaultsTerminatedByHeader(IntegrationTest):
|
||||||
assert task['tags'] == set()
|
assert task['tags'] == set()
|
||||||
|
|
||||||
|
|
||||||
class TestViewportInspection(IntegrationTest):
|
class TestViewportInspection(MultiSyntaxIntegrationTest):
|
||||||
|
|
||||||
viminput = """
|
viminput = """
|
||||||
=== Work tasks | +work ===
|
HEADER2(Work tasks | +work)
|
||||||
* [ ] tag work task #{uuid}
|
* [ ] tag work task #{uuid}
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
@ -279,13 +279,13 @@ class TestViewportInspection(IntegrationTest):
|
||||||
assert self.py("print(vim.current.buffer)", regex="<buffer taskwiki.")
|
assert self.py("print(vim.current.buffer)", regex="<buffer taskwiki.")
|
||||||
|
|
||||||
|
|
||||||
class TestViewportInspectionWithVisibleTag(IntegrationTest):
|
class TestViewportInspectionWithVisibleTag(MultiSyntaxIntegrationTest):
|
||||||
|
|
||||||
viminput = """
|
viminput = """
|
||||||
=== Work tasks | +work -VISIBLE ===
|
HEADER2(Work tasks | +work -VISIBLE)
|
||||||
* [ ] tag work task #{uuid}
|
* [ ] tag work task #{uuid}
|
||||||
|
|
||||||
=== Home tasks | +home ===
|
HEADER2(Home tasks | +home)
|
||||||
* [ ] tag work task #{uuid}
|
* [ ] tag work task #{uuid}
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
@ -317,14 +317,14 @@ class TestViewportInspectionWithVisibleTag(IntegrationTest):
|
||||||
assert self.py("print(vim.current.buffer)", regex="<buffer taskwiki.")
|
assert self.py("print(vim.current.buffer)", regex="<buffer taskwiki.")
|
||||||
|
|
||||||
|
|
||||||
class TestViewportsUnicodeTaskGeneration(IntegrationTest):
|
class TestViewportsUnicodeTaskGeneration(MultiSyntaxIntegrationTest):
|
||||||
|
|
||||||
viminput = """
|
viminput = """
|
||||||
=== Work tasks | +work ===
|
HEADER2(Work tasks | +work)
|
||||||
"""
|
"""
|
||||||
|
|
||||||
vimoutput = u"""
|
vimoutput = u"""
|
||||||
=== Work tasks | +work ===
|
HEADER2(Work tasks | +work)
|
||||||
* [ ] tag work täsk #{uuid}
|
* [ ] tag work täsk #{uuid}
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
@ -336,14 +336,14 @@ class TestViewportsUnicodeTaskGeneration(IntegrationTest):
|
||||||
self.command("w", regex="written$", lines=1)
|
self.command("w", regex="written$", lines=1)
|
||||||
|
|
||||||
|
|
||||||
class TestUnicodeViewportsUnicodeTaskGeneration(IntegrationTest):
|
class TestUnicodeViewportsUnicodeTaskGeneration(MultiSyntaxIntegrationTest):
|
||||||
|
|
||||||
viminput = u"""
|
viminput = u"""
|
||||||
=== Réunion 2017 | project:Réunion2017 ===
|
HEADER2(Réunion 2017 | project:Réunion2017)
|
||||||
"""
|
"""
|
||||||
|
|
||||||
vimoutput = u"""
|
vimoutput = u"""
|
||||||
=== Réunion 2017 | project:Réunion2017 ===
|
HEADER2(Réunion 2017 | project:Réunion2017)
|
||||||
* [ ] Réunion task 1 #{uuid}
|
* [ ] Réunion task 1 #{uuid}
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
@ -356,15 +356,15 @@ class TestUnicodeViewportsUnicodeTaskGeneration(IntegrationTest):
|
||||||
assert len(self.tw.tasks.pending()) == 1
|
assert len(self.tw.tasks.pending()) == 1
|
||||||
|
|
||||||
|
|
||||||
class TestUnicodeViewportsUnicodeDefaultsAssignment(IntegrationTest):
|
class TestUnicodeViewportsUnicodeDefaultsAssignment(MultiSyntaxIntegrationTest):
|
||||||
|
|
||||||
viminput = u"""
|
viminput = u"""
|
||||||
=== Réunion 2017 | project:Réunion2017 ===
|
HEADER2(Réunion 2017 | project:Réunion2017)
|
||||||
* [ ] Réunion task 1
|
* [ ] Réunion task 1
|
||||||
"""
|
"""
|
||||||
|
|
||||||
vimoutput = u"""
|
vimoutput = u"""
|
||||||
=== Réunion 2017 | project:Réunion2017 ===
|
HEADER2(Réunion 2017 | project:Réunion2017)
|
||||||
* [ ] Réunion task 1 #{uuid}
|
* [ ] Réunion task 1 #{uuid}
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
@ -378,14 +378,14 @@ class TestUnicodeViewportsUnicodeDefaultsAssignment(IntegrationTest):
|
||||||
assert task['project'] == u'Réunion2017'
|
assert task['project'] == u'Réunion2017'
|
||||||
|
|
||||||
|
|
||||||
class TestViewportsSortedGeneration(IntegrationTest):
|
class TestViewportsSortedGeneration(MultiSyntaxIntegrationTest):
|
||||||
|
|
||||||
viminput = """
|
viminput = """
|
||||||
=== Work tasks | +work ===
|
HEADER2(Work tasks | +work)
|
||||||
"""
|
"""
|
||||||
|
|
||||||
vimoutput = """
|
vimoutput = """
|
||||||
=== Work tasks | +work ===
|
HEADER2(Work tasks | +work)
|
||||||
* [ ] main task 1 (2015-08-07) #{uuid}
|
* [ ] main task 1 (2015-08-07) #{uuid}
|
||||||
* [ ] sub task 1a (2015-08-01) #{uuid}
|
* [ ] sub task 1a (2015-08-01) #{uuid}
|
||||||
* [ ] sub task 1aa #{uuid}
|
* [ ] sub task 1aa #{uuid}
|
||||||
|
@ -426,7 +426,7 @@ class TestViewportsSortedGeneration(IntegrationTest):
|
||||||
class TestViewportsSortedGenerationReverse(TestViewportsSortedGeneration):
|
class TestViewportsSortedGenerationReverse(TestViewportsSortedGeneration):
|
||||||
|
|
||||||
vimoutput = """
|
vimoutput = """
|
||||||
=== Work tasks | +work ===
|
HEADER2(Work tasks | +work)
|
||||||
* [ ] main task 3 (2015-08-09) #{uuid}
|
* [ ] main task 3 (2015-08-09) #{uuid}
|
||||||
* [ ] sub task 3a (2015-08-03) #{uuid}
|
* [ ] sub task 3a (2015-08-03) #{uuid}
|
||||||
* [ ] sub task 3b #{uuid}
|
* [ ] sub task 3b #{uuid}
|
||||||
|
@ -446,14 +446,14 @@ class TestViewportsSortedGenerationReverse(TestViewportsSortedGeneration):
|
||||||
super(TestViewportsSortedGenerationReverse, self).execute()
|
super(TestViewportsSortedGenerationReverse, self).execute()
|
||||||
|
|
||||||
|
|
||||||
class TestViewportsMultilevelSortedGeneration(IntegrationTest):
|
class TestViewportsMultilevelSortedGeneration(MultiSyntaxIntegrationTest):
|
||||||
|
|
||||||
viminput = """
|
viminput = """
|
||||||
=== Work tasks | project:Work or project:Home ===
|
HEADER2(Work tasks | project:Work or project:Home)
|
||||||
"""
|
"""
|
||||||
|
|
||||||
vimoutput = """
|
vimoutput = """
|
||||||
=== Work tasks | project:Work or project:Home ===
|
HEADER2(Work tasks | project:Work or project:Home)
|
||||||
* [ ] home task 1 (2015-08-01) #{uuid}
|
* [ ] home task 1 (2015-08-01) #{uuid}
|
||||||
* [ ] home task 2 (2015-08-02) #{uuid}
|
* [ ] home task 2 (2015-08-02) #{uuid}
|
||||||
* [ ] home task 3 (2015-08-03) #{uuid}
|
* [ ] home task 3 (2015-08-03) #{uuid}
|
||||||
|
@ -479,14 +479,14 @@ class TestViewportsMultilevelSortedGeneration(IntegrationTest):
|
||||||
self.command("w", regex="written$", lines=1)
|
self.command("w", regex="written$", lines=1)
|
||||||
|
|
||||||
|
|
||||||
class TestViewportsSpecificSorting(IntegrationTest):
|
class TestViewportsSpecificSorting(MultiSyntaxIntegrationTest):
|
||||||
|
|
||||||
viminput = """
|
viminput = """
|
||||||
=== Work tasks | project:Work or project:Home $T ===
|
HEADER2(Work tasks | project:Work or project:Home $T)
|
||||||
"""
|
"""
|
||||||
|
|
||||||
vimoutput = """
|
vimoutput = """
|
||||||
=== Work tasks | project:Work or project:Home $T ===
|
HEADER2(Work tasks | project:Work or project:Home $T)
|
||||||
* [ ] home task 1 (2015-08-01) #{uuid}
|
* [ ] home task 1 (2015-08-01) #{uuid}
|
||||||
* [ ] home task 2 (2015-08-02) #{uuid}
|
* [ ] home task 2 (2015-08-02) #{uuid}
|
||||||
* [ ] work task 1 (2015-08-01) #{uuid}
|
* [ ] work task 1 (2015-08-01) #{uuid}
|
||||||
|
@ -511,19 +511,19 @@ class TestViewportsSpecificSorting(IntegrationTest):
|
||||||
class TestViewportsSpecificSortingCombined(TestViewportsSpecificSorting):
|
class TestViewportsSpecificSortingCombined(TestViewportsSpecificSorting):
|
||||||
|
|
||||||
viminput = """
|
viminput = """
|
||||||
=== Work tasks | project:Work or project:Home $T ===
|
HEADER2(Work tasks | project:Work or project:Home $T)
|
||||||
|
|
||||||
=== Work tasks | project:Work or project:Home ===
|
HEADER2(Work tasks | project:Work or project:Home)
|
||||||
"""
|
"""
|
||||||
|
|
||||||
vimoutput = """
|
vimoutput = """
|
||||||
=== Work tasks | project:Work or project:Home $T ===
|
HEADER2(Work tasks | project:Work or project:Home $T)
|
||||||
* [ ] home task 1 (2015-08-01) #{uuid}
|
* [ ] home task 1 (2015-08-01) #{uuid}
|
||||||
* [ ] home task 2 (2015-08-02) #{uuid}
|
* [ ] home task 2 (2015-08-02) #{uuid}
|
||||||
* [ ] work task 1 (2015-08-01) #{uuid}
|
* [ ] work task 1 (2015-08-01) #{uuid}
|
||||||
* [ ] work task 2 (2015-08-02) #{uuid}
|
* [ ] work task 2 (2015-08-02) #{uuid}
|
||||||
|
|
||||||
=== Work tasks | project:Work or project:Home ===
|
HEADER2(Work tasks | project:Work or project:Home)
|
||||||
* [ ] home task 1 (2015-08-01) #{uuid}
|
* [ ] home task 1 (2015-08-01) #{uuid}
|
||||||
* [ ] work task 1 (2015-08-01) #{uuid}
|
* [ ] work task 1 (2015-08-01) #{uuid}
|
||||||
* [ ] home task 2 (2015-08-02) #{uuid}
|
* [ ] home task 2 (2015-08-02) #{uuid}
|
||||||
|
@ -531,14 +531,14 @@ class TestViewportsSpecificSortingCombined(TestViewportsSpecificSorting):
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
|
||||||
class TestViewportsSortedInvalidOrder(IntegrationTest):
|
class TestViewportsSortedInvalidOrder(MultiSyntaxIntegrationTest):
|
||||||
|
|
||||||
viminput = """
|
viminput = """
|
||||||
=== Work tasks | +work $X ===
|
HEADER2(Work tasks | +work $X)
|
||||||
"""
|
"""
|
||||||
|
|
||||||
vimoutput = """
|
vimoutput = """
|
||||||
=== Work tasks | +work $X ===
|
HEADER2(Work tasks | +work $X)
|
||||||
"""
|
"""
|
||||||
|
|
||||||
def execute(self):
|
def execute(self):
|
||||||
|
@ -547,19 +547,19 @@ class TestViewportsSortedInvalidOrder(IntegrationTest):
|
||||||
"'Work tasks' is not defined, using default.", lines=2)
|
"'Work tasks' is not defined, using default.", lines=2)
|
||||||
|
|
||||||
|
|
||||||
class TestViewportsVisibleMetaTag(IntegrationTest):
|
class TestViewportsVisibleMetaTag(MultiSyntaxIntegrationTest):
|
||||||
|
|
||||||
viminput = """
|
viminput = """
|
||||||
=== Home tasks | project:Home -VISIBLE ===
|
HEADER2(Home tasks | project:Home -VISIBLE)
|
||||||
|
|
||||||
=== Chores | project:Home.Chores ===
|
HEADER2(Chores | project:Home.Chores)
|
||||||
"""
|
"""
|
||||||
|
|
||||||
vimoutput = """
|
vimoutput = """
|
||||||
=== Home tasks | project:Home -VISIBLE ===
|
HEADER2(Home tasks | project:Home -VISIBLE)
|
||||||
* [ ] home task #{uuid}
|
* [ ] home task #{uuid}
|
||||||
|
|
||||||
=== Chores | project:Home.Chores ===
|
HEADER2(Chores | project:Home.Chores)
|
||||||
* [ ] chore task #{uuid}
|
* [ ] chore task #{uuid}
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
@ -574,17 +574,17 @@ class TestViewportsVisibleMetaTag(IntegrationTest):
|
||||||
self.command("w", regex="written$", lines=1)
|
self.command("w", regex="written$", lines=1)
|
||||||
|
|
||||||
|
|
||||||
class TestViewportsPreserveHierarchyUponCompletion(IntegrationTest):
|
class TestViewportsPreserveHierarchyUponCompletion(MultiSyntaxIntegrationTest):
|
||||||
|
|
||||||
viminput = """
|
viminput = """
|
||||||
=== Work tasks | +work ===
|
HEADER2(Work tasks | +work)
|
||||||
* [ ] main task
|
* [ ] main task
|
||||||
* [ ] sub task a
|
* [ ] sub task a
|
||||||
* [ ] sub task b
|
* [ ] sub task b
|
||||||
"""
|
"""
|
||||||
|
|
||||||
vimoutput = """
|
vimoutput = """
|
||||||
=== Work tasks | +work ===
|
HEADER2(Work tasks | +work)
|
||||||
* [ ] main task #{uuid}
|
* [ ] main task #{uuid}
|
||||||
* [X] sub task a #{uuid}
|
* [X] sub task a #{uuid}
|
||||||
* [ ] sub task b #{uuid}
|
* [ ] sub task b #{uuid}
|
||||||
|
@ -601,15 +601,15 @@ class TestViewportsPreserveHierarchyUponCompletion(IntegrationTest):
|
||||||
sleep(0.5)
|
sleep(0.5)
|
||||||
|
|
||||||
|
|
||||||
class TestViewportDefaultPreservesTags(IntegrationTest):
|
class TestViewportDefaultPreservesTags(MultiSyntaxIntegrationTest):
|
||||||
|
|
||||||
viminput = """
|
viminput = """
|
||||||
=== Work tasks | +work ===
|
HEADER2(Work tasks | +work)
|
||||||
* [ ] hard task -- +hard
|
* [ ] hard task -- +hard
|
||||||
"""
|
"""
|
||||||
|
|
||||||
vimoutput = """
|
vimoutput = """
|
||||||
=== Work tasks | +work ===
|
HEADER2(Work tasks | +work)
|
||||||
* [ ] hard task #{uuid}
|
* [ ] hard task #{uuid}
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue