mirror of
https://github.com/GothenburgBitFactory/taskwarrior.git
synced 2025-07-07 20:06:36 +02:00
Test: Merged bug.649.t into recurrence.t
This commit is contained in:
parent
ed3eb31d7e
commit
33cf2735cf
4 changed files with 20 additions and 63 deletions
|
@ -1,55 +0,0 @@
|
|||
#!/usr/bin/env python2.7
|
||||
# -*- coding: utf-8 -*-
|
||||
###############################################################################
|
||||
#
|
||||
# Copyright 2006 - 2015, Paul Beckingham, Federico Hernandez.
|
||||
#
|
||||
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
# of this software and associated documentation files (the "Software"), to deal
|
||||
# in the Software without restriction, including without limitation the rights
|
||||
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
# copies of the Software, and to permit persons to whom the Software is
|
||||
# furnished to do so, subject to the following conditions:
|
||||
#
|
||||
# The above copyright notice and this permission notice shall be included
|
||||
# in all copies or substantial portions of the Software.
|
||||
#
|
||||
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
|
||||
# OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
||||
# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
# SOFTWARE.
|
||||
#
|
||||
# http://www.opensource.org/licenses/mit-license.php
|
||||
#
|
||||
###############################################################################
|
||||
|
||||
import sys
|
||||
import os
|
||||
import unittest
|
||||
# Ensure python finds the local simpletap module
|
||||
sys.path.append(os.path.dirname(os.path.abspath(__file__)))
|
||||
|
||||
from basetest import Task, TestCase
|
||||
|
||||
|
||||
class TestBug649(TestCase):
|
||||
def setUp(self):
|
||||
"""Executed before each test in the class"""
|
||||
self.t = Task()
|
||||
|
||||
def test_delete_recurring_immediately(self):
|
||||
"""Verify that recurring tasks cannot be immediately marked completed"""
|
||||
self.t("add one due:3d recur:1week")
|
||||
code, out, err = self.t.runError("1 done")
|
||||
self.assertIn("is neither pending nor waiting", out)
|
||||
self.assertNotIn("Completed 1", out)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
from simpletap import TAPTestRunner
|
||||
unittest.main(testRunner=TAPTestRunner())
|
||||
|
||||
# vim: ai sts=4 et sw=4 ft=python
|
|
@ -92,7 +92,7 @@ class TestBug425(TestCase):
|
|||
self.t = Task()
|
||||
|
||||
def test_bug425(self):
|
||||
"""Make sure parser sees 'in' and not an abbreviated 'info'"""
|
||||
"""425: Make sure parser sees 'in' and not an abbreviated 'info'"""
|
||||
self.t("add Foo")
|
||||
self.t("1 modify Bar in Bar")
|
||||
|
||||
|
|
|
@ -289,7 +289,7 @@ class TestBug932(TestCase):
|
|||
self.t.config("report.id_pri_proj.labels", "ID,P,Proj")
|
||||
|
||||
def test_modify_due_propagate(self):
|
||||
"""Verify due date modifications propagate"""
|
||||
"""932: Verify due date modifications propagate"""
|
||||
|
||||
# add a recurring task with multiple child tasks
|
||||
# - modify a child task and test for propagation
|
||||
|
@ -319,7 +319,7 @@ class TestBug955(TestCase):
|
|||
self.assertRegexpMatches(out, re.compile("^2 tasks", re.MULTILINE))
|
||||
|
||||
def test_no_prompt_for_parent_on_child_delete_confirmation_off(self):
|
||||
"""Deleting a child of a recurring task prompts for parent deletion (confirmation:off)
|
||||
"""955: Deleting a child of a recurring task prompts for parent deletion (confirmation:off)
|
||||
|
||||
Previously bug.955.t
|
||||
"""
|
||||
|
@ -412,7 +412,7 @@ class BaseTestBug360(TestCase):
|
|||
|
||||
class TestBug360RemovalError(BaseTestBug360):
|
||||
def test_modify_recursive_project(self):
|
||||
"""Modifying a recursive task by adding project: also modifies parent
|
||||
"""360: Modifying a recursive task by adding project: also modifies parent
|
||||
"""
|
||||
code, out, err = self.t("1 modify project:bar", input="y\n")
|
||||
|
||||
|
@ -422,7 +422,7 @@ class TestBug360RemovalError(BaseTestBug360):
|
|||
self.assertNotIn(expected, err)
|
||||
|
||||
def test_cannot_remove_recurrence(self):
|
||||
"""Cannot remove recurrence from recurring task
|
||||
"""360: Cannot remove recurrence from recurring task
|
||||
"""
|
||||
# TODO Removing recur: from a recurring task should also remove imask
|
||||
# and parent.
|
||||
|
@ -435,7 +435,7 @@ class TestBug360RemovalError(BaseTestBug360):
|
|||
self.assertIn(expected, err)
|
||||
|
||||
def test_cannot_remove_due_date(self):
|
||||
"""Cannot remove due date from recurring task
|
||||
"""360: Cannot remove due date from recurring task
|
||||
"""
|
||||
# TODO Removing due: from a recurring task should also remove recur,
|
||||
# imask and parent
|
||||
|
@ -456,7 +456,7 @@ class TestBug360AllowedChanges(BaseTestBug360):
|
|||
self.t("add nonrecurring due:today")
|
||||
|
||||
def test_allow_modify_due_in_nonrecurring(self):
|
||||
"""Allow modifying due date in non recurring task"""
|
||||
"""360: Allow modifying due date in non recurring task"""
|
||||
# Retrieve the id of the non recurring task
|
||||
code, out, err = self.t("ls")
|
||||
|
||||
|
@ -478,6 +478,18 @@ class TestBug360AllowedChanges(BaseTestBug360):
|
|||
expected = "No duplicates found"
|
||||
self.assertIn(expected, out)
|
||||
|
||||
class TestBug649(TestCase):
|
||||
def setUp(self):
|
||||
"""Executed before each test in the class"""
|
||||
self.t = Task()
|
||||
|
||||
def test_delete_recurring_immediately(self):
|
||||
"""649: Verify that recurring tasks cannot be immediately marked completed"""
|
||||
self.t("add one due:3d recur:1week")
|
||||
code, out, err = self.t.runError("1 done")
|
||||
self.assertIn("is neither pending nor waiting", out)
|
||||
self.assertNotIn("Completed 1", out)
|
||||
|
||||
|
||||
# TODO Wait a recurring task
|
||||
# TODO Downgrade a recurring task to a regular task
|
||||
|
|
|
@ -89,7 +89,7 @@ class TestBug441(TestCase):
|
|||
self.t = Task()
|
||||
|
||||
def test_bad_colon_replacement(self):
|
||||
"""Substitution containing a colon"""
|
||||
"""441: Substitution containing a colon"""
|
||||
|
||||
self.t("add one two three")
|
||||
self.t("1 modify /two/two:/")
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue