mirror of
https://github.com/GothenburgBitFactory/taskwarrior.git
synced 2025-06-26 10:54:26 +02:00
Test: Merged bug.835.t into project.t
This commit is contained in:
parent
9690cad46a
commit
1434e0366c
2 changed files with 24 additions and 66 deletions
|
@ -1,58 +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 TestBug835(TestCase):
|
|
||||||
def setUp(self):
|
|
||||||
"""Executed before each test in the class"""
|
|
||||||
self.t = Task()
|
|
||||||
|
|
||||||
def test_project_hierarchy_filter(self):
|
|
||||||
"""Verify filter on project hierarchy, plus parentheses"""
|
|
||||||
self.t("add pro:main.subproject one")
|
|
||||||
code, out, err = self.t("ls")
|
|
||||||
self.assertIn("main.subproject", out)
|
|
||||||
|
|
||||||
code, out, err = self.t("(pro:main.subproject) ls")
|
|
||||||
self.assertIn("main.subproject", out)
|
|
||||||
self.assertNotIn("Mismatched parentheses in expression", out)
|
|
||||||
|
|
||||||
|
|
||||||
if __name__ == "__main__":
|
|
||||||
from simpletap import TAPTestRunner
|
|
||||||
unittest.main(testRunner=TAPTestRunner())
|
|
||||||
|
|
||||||
# vim: ai sts=4 et sw=4 ft=python
|
|
|
@ -182,7 +182,7 @@ class TestBug299(TestCase):
|
||||||
self.t("add project:three baz")
|
self.t("add project:three baz")
|
||||||
|
|
||||||
def test_project_exclusion_isnt(self):
|
def test_project_exclusion_isnt(self):
|
||||||
"""check project exclusion using project.isnt:<name>
|
"""299: check project exclusion using project.isnt:<name>
|
||||||
|
|
||||||
Reported in bug 299
|
Reported in bug 299
|
||||||
"""
|
"""
|
||||||
|
@ -197,7 +197,7 @@ class TestBug299(TestCase):
|
||||||
self.assertRegexpMatches(out, "three.*baz")
|
self.assertRegexpMatches(out, "three.*baz")
|
||||||
|
|
||||||
def test_project_exclusion_hasnt(self):
|
def test_project_exclusion_hasnt(self):
|
||||||
"""check project exclusion using project.hasnt:<name>
|
"""299: check project exclusion using project.hasnt:<name>
|
||||||
|
|
||||||
Reported in bug 299
|
Reported in bug 299
|
||||||
"""
|
"""
|
||||||
|
@ -217,7 +217,7 @@ class TestBug555(TestCase):
|
||||||
self.t = Task()
|
self.t = Task()
|
||||||
|
|
||||||
def test_log_with_project_segfault(self):
|
def test_log_with_project_segfault(self):
|
||||||
"""log with a project causes a segfault
|
"""555: log with a project causes a segfault
|
||||||
|
|
||||||
Reported in bug 555
|
Reported in bug 555
|
||||||
"""
|
"""
|
||||||
|
@ -233,7 +233,7 @@ class TestBug605(TestCase):
|
||||||
self.t = Task()
|
self.t = Task()
|
||||||
|
|
||||||
def test_delete_task_for_empty_project(self):
|
def test_delete_task_for_empty_project(self):
|
||||||
"""Project correctly reports % completion when empty or all tasks completed
|
"""605: Project correctly reports % completion when empty or all tasks completed
|
||||||
|
|
||||||
Reported in bug 605
|
Reported in bug 605
|
||||||
"""
|
"""
|
||||||
|
@ -247,12 +247,28 @@ class TestBug605(TestCase):
|
||||||
self.assertIn("is 100% complete", err)
|
self.assertIn("is 100% complete", err)
|
||||||
|
|
||||||
|
|
||||||
|
class TestBug835(TestCase):
|
||||||
|
def setUp(self):
|
||||||
|
"""Executed before each test in the class"""
|
||||||
|
self.t = Task()
|
||||||
|
|
||||||
|
def test_project_hierarchy_filter(self):
|
||||||
|
"""835: Verify filter on project hierarchy, plus parentheses"""
|
||||||
|
self.t("add pro:main.subproject one")
|
||||||
|
code, out, err = self.t("ls")
|
||||||
|
self.assertIn("main.subproject", out)
|
||||||
|
|
||||||
|
code, out, err = self.t("(pro:main.subproject) ls")
|
||||||
|
self.assertIn("main.subproject", out)
|
||||||
|
self.assertNotIn("Mismatched parentheses in expression", out)
|
||||||
|
|
||||||
|
|
||||||
class TestBug906(TestCase):
|
class TestBug906(TestCase):
|
||||||
def setUp(self):
|
def setUp(self):
|
||||||
self.t = Task()
|
self.t = Task()
|
||||||
|
|
||||||
def test_project_hierarchy_filter(self):
|
def test_project_hierarchy_filter(self):
|
||||||
"""Test project hierarchy filters
|
"""906: Test project hierarchy filters
|
||||||
|
|
||||||
Bug 906
|
Bug 906
|
||||||
"""
|
"""
|
||||||
|
@ -286,7 +302,7 @@ class TestBug856(TestCase):
|
||||||
self.t = Task()
|
self.t = Task()
|
||||||
|
|
||||||
def test_project_hierarchy_filter(self):
|
def test_project_hierarchy_filter(self):
|
||||||
"""Test project.none: works
|
"""856: Test project.none: works
|
||||||
|
|
||||||
Bug 856: "task list project.none:" does not work.
|
Bug 856: "task list project.none:" does not work.
|
||||||
"""
|
"""
|
||||||
|
@ -311,7 +327,7 @@ class TestBug1511(TestCase):
|
||||||
self.t = Task()
|
self.t = Task()
|
||||||
|
|
||||||
def test_project_hierarchy_filter(self):
|
def test_project_hierarchy_filter(self):
|
||||||
"""Test project:one-two can be added and queried
|
"""1511: Test project:one-two can be added and queried
|
||||||
|
|
||||||
Bug 1511: Project titles not properly parsed if they contain hyphens
|
Bug 1511: Project titles not properly parsed if they contain hyphens
|
||||||
"""
|
"""
|
||||||
|
@ -327,7 +343,7 @@ class TestBug1455(TestCase):
|
||||||
self.t = Task()
|
self.t = Task()
|
||||||
|
|
||||||
def test_project_hierarchy_filter(self):
|
def test_project_hierarchy_filter(self):
|
||||||
"""Test project:school)
|
"""1455: Test project:school)
|
||||||
|
|
||||||
Bug 1455: Filter parser does not properly handle parentheses in attributes
|
Bug 1455: Filter parser does not properly handle parentheses in attributes
|
||||||
"""
|
"""
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue