Files
taskwarrior-2.x/test/bug.1418.t
Ralph Bean d2222a4082 Unit Tests
- Added a set of failing tests for the 'filters in operators' bug:
  https://bug.tasktools.org/browse/TW-1418
2014-09-27 10:39:26 -04:00

57 lines
1.5 KiB
Python
Executable File

#!/usr/bin/env python2.7
# -*- coding: utf-8 -*-
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, Taskd, ServerTestCase
class Test1418(TestCase):
def setUp(self):
self.t = Task()
def test_slash_in_description(self):
"""Check that you can search with a slash (/)"""
command = ("add", "foo/bar")
code, out, err = self.t(command)
self.assertEquals(code, 0)
command = ("foo/bar",)
code, out, err = self.t(command)
self.assertEquals(code, 0)
self.assertIn("foo/bar", out)
def test_minus_in_description(self):
"""Check that you can search with a minus (-)"""
command = ("add", "foo-")
code, out, err = self.t(command)
self.assertEquals(code, 0)
command = ("foo-",)
code, out, err = self.t(command)
self.assertEquals(code, 0)
self.assertIn("foo-", out)
def test_plus_in_description(self):
"""Check that you can search with a plus (+)"""
command = ("add", "foo+")
code, out, err = self.t(command)
self.assertEquals(code, 0)
command = ("foo+",)
code, out, err = self.t(command)
self.assertEquals(code, 0)
self.assertIn("foo+", out)
if __name__ == "__main__":
from simpletap import TAPTestRunner
unittest.main(testRunner=TAPTestRunner())
# vim: ai sts=4 et sw=4