import re from tests.base import IntegrationTest from tasklib import local_zone from datetime import datetime def current_year(): return local_zone.localize(datetime.now()).year def current_month(): current_month_number = local_zone.localize(datetime.now()).month months = ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"] return months[current_month_number - 1] class TestBurndownDailySimple(IntegrationTest): def execute(self): self.command("TaskWikiBurndownDaily") assert self.command(":py print vim.current.buffer", silent=False).startswith("= '2.4.2' else '1']) chores = r'\s*'.join(['Chores', '2']) work = r'\s*'.join(['Work', '2']) assert re.search(header, output, re.MULTILINE) assert re.search(home, output, re.MULTILINE) assert re.search(chores, output, re.MULTILINE) assert re.search(work, output, re.MULTILINE) class TestSummarySimple(IntegrationTest): tasks = [ dict(description="home task", project="Home"), dict(description="home chore task 1", project="Home.Chores"), dict(description="home chore task 2", project="Home.Chores"), dict(description="work task 1", project="Work"), dict(description="work task 2", project="Work"), ] def execute(self): self.command("TaskWikiProjectsSummary") assert self.command(":py print vim.current.buffer", silent=False).startswith("= '2.4.2' else '1']) chores = r'\s*'.join(['Chores', '2']) work = r'\s*'.join(['Work', '2']) assert re.search(header, output, re.MULTILINE) assert re.search(home, output, re.MULTILINE) assert re.search(chores, output, re.MULTILINE) assert re.search(work, output, re.MULTILINE) class TestStatsSimple(IntegrationTest): tasks = [ dict(description="home task"), dict(description="home chore task 1", tags=['chore']), dict(description="home chore task 2", tags=['chore']), dict(description="work task 1", tags=['work']), dict(description="work task 2", tags=['work']), ] def execute(self): self.command("TaskWikiStats") assert self.command(":py print vim.current.buffer", silent=False).startswith("