Test: Merged bug.649.t into recurrence.t

This commit is contained in:
Paul Beckingham 2015-10-23 07:14:43 -04:00
parent ed3eb31d7e
commit 33cf2735cf
4 changed files with 20 additions and 63 deletions

View file

@ -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

View file

@ -92,7 +92,7 @@ class TestBug425(TestCase):
self.t = Task() self.t = Task()
def test_bug425(self): 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("add Foo")
self.t("1 modify Bar in Bar") self.t("1 modify Bar in Bar")

View file

@ -289,7 +289,7 @@ class TestBug932(TestCase):
self.t.config("report.id_pri_proj.labels", "ID,P,Proj") self.t.config("report.id_pri_proj.labels", "ID,P,Proj")
def test_modify_due_propagate(self): 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 # add a recurring task with multiple child tasks
# - modify a child task and test for propagation # - modify a child task and test for propagation
@ -319,7 +319,7 @@ class TestBug955(TestCase):
self.assertRegexpMatches(out, re.compile("^2 tasks", re.MULTILINE)) self.assertRegexpMatches(out, re.compile("^2 tasks", re.MULTILINE))
def test_no_prompt_for_parent_on_child_delete_confirmation_off(self): 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 Previously bug.955.t
""" """
@ -412,7 +412,7 @@ class BaseTestBug360(TestCase):
class TestBug360RemovalError(BaseTestBug360): class TestBug360RemovalError(BaseTestBug360):
def test_modify_recursive_project(self): 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") code, out, err = self.t("1 modify project:bar", input="y\n")
@ -422,7 +422,7 @@ class TestBug360RemovalError(BaseTestBug360):
self.assertNotIn(expected, err) self.assertNotIn(expected, err)
def test_cannot_remove_recurrence(self): 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 # TODO Removing recur: from a recurring task should also remove imask
# and parent. # and parent.
@ -435,7 +435,7 @@ class TestBug360RemovalError(BaseTestBug360):
self.assertIn(expected, err) self.assertIn(expected, err)
def test_cannot_remove_due_date(self): 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, # TODO Removing due: from a recurring task should also remove recur,
# imask and parent # imask and parent
@ -456,7 +456,7 @@ class TestBug360AllowedChanges(BaseTestBug360):
self.t("add nonrecurring due:today") self.t("add nonrecurring due:today")
def test_allow_modify_due_in_nonrecurring(self): 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 # Retrieve the id of the non recurring task
code, out, err = self.t("ls") code, out, err = self.t("ls")
@ -478,6 +478,18 @@ class TestBug360AllowedChanges(BaseTestBug360):
expected = "No duplicates found" expected = "No duplicates found"
self.assertIn(expected, out) 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 Wait a recurring task
# TODO Downgrade a recurring task to a regular task # TODO Downgrade a recurring task to a regular task

View file

@ -89,7 +89,7 @@ class TestBug441(TestCase):
self.t = Task() self.t = Task()
def test_bad_colon_replacement(self): def test_bad_colon_replacement(self):
"""Substitution containing a colon""" """441: Substitution containing a colon"""
self.t("add one two three") self.t("add one two three")
self.t("1 modify /two/two:/") self.t("1 modify /two/two:/")