From a007d6c174d94f7395b7fa80ccc0738809155992 Mon Sep 17 00:00:00 2001 From: Paul Beckingham Date: Sun, 19 Jul 2015 18:09:55 -0400 Subject: [PATCH] TW-1521: task project!=PROJECTNAME does not work (Regression) - Thanks to Florian Petry. --- AUTHORS | 1 + ChangeLog | 2 ++ test/tw-1521.t | 66 ++++++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 69 insertions(+) create mode 100755 test/tw-1521.t diff --git a/AUTHORS b/AUTHORS index b7597ff6b..a9c88afcd 100644 --- a/AUTHORS +++ b/AUTHORS @@ -261,3 +261,4 @@ suggestions: Blake Sweeney Dylan Mikus Andrea Rizzi + Florian Petry diff --git a/ChangeLog b/ChangeLog index 7303fad23..406ac99a9 100644 --- a/ChangeLog +++ b/ChangeLog @@ -32,6 +32,8 @@ - TW-1488 You have more urgent tasks (thanks to Stefan Betz, Denis Kasak). - TW-1511 Project titles not properly parsed if they contain hyphens (thanks to Leon Feng, Blake Sweeney, Dylan Mikus). +- TW-1521 task project!=PROJECTNAME does not work (Regression) (thanks to + Florian Petry). - TW-1527 Extra spaces added around slashes (thanks to Renato Alves). - TW-1529 Parser incorrectly inserting spaces into task description (thanks to David Brenner). diff --git a/test/tw-1521.t b/test/tw-1521.t new file mode 100755 index 000000000..a5981df2b --- /dev/null +++ b/test/tw-1521.t @@ -0,0 +1,66 @@ +#!/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 TestBug1521(TestCase): + @classmethod + def setUpClass(cls): + """Executed once before any test in the class""" + cls.t = Task() + cls.t.config("verbose", "nothing") + cls.t("add one project:WORK") + cls.t("add two project:HOME") + + def setUp(self): + """Executed before each test in the class""" + + def test_project_inequality(self): + """Verify that 'project.not' works""" + code, out, err = self.t("project.not:WORK list") + self.assertNotIn("one", out) + self.assertIn("two", out) + + def test_project_not_equal(self): + """Verify that 'project !=' works""" + code, out, err = self.t("project != WORK list") + self.assertNotIn("one", out) + self.assertIn("two", out) + +if __name__ == "__main__": + from simpletap import TAPTestRunner + unittest.main(testRunner=TAPTestRunner()) + +# vim: ai sts=4 et sw=4