mirror of
https://github.com/GothenburgBitFactory/taskwarrior.git
synced 2025-06-26 10:54:26 +02:00
Unit Tests
- Added a set of failing tests for the 'filters in operators' bug: https://bug.tasktools.org/browse/TW-1418
This commit is contained in:
parent
69d4e0392b
commit
d2222a4082
1 changed files with 56 additions and 0 deletions
56
test/bug.1418.t
Executable file
56
test/bug.1418.t
Executable file
|
@ -0,0 +1,56 @@
|
|||
#!/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
|
Loading…
Add table
Add a link
Reference in a new issue