mirror of
https://github.com/GothenburgBitFactory/taskwarrior.git
synced 2025-08-19 19:03:07 +02:00
Unit Tests
- Added partial match tests for dates.
This commit is contained in:
parent
a0736706e8
commit
2f03fc5d56
1 changed files with 33 additions and 0 deletions
33
test/partial.t
Executable file
33
test/partial.t
Executable file
|
@ -0,0 +1,33 @@
|
|||
#!/usr/bin/env python2.7
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
import sys
|
||||
import os
|
||||
import unittest
|
||||
from datetime import datetime
|
||||
# Ensure python finds the local simpletap module
|
||||
sys.path.append(os.path.dirname(os.path.abspath(__file__)))
|
||||
|
||||
from basetest import Task, TestCase
|
||||
|
||||
|
||||
class TestPartialMatch(TestCase):
|
||||
@classmethod
|
||||
def setUpClass(cls):
|
||||
cls.t = Task()
|
||||
|
||||
def test_partial_date_match(self):
|
||||
"""Partial match for dates: today=now --> true"""
|
||||
code, out, err = self.t(('calc', 'today=now'))
|
||||
self.assertIn('true', out)
|
||||
|
||||
def test_exact_date_match(self):
|
||||
"""Exact match for dates: today==now --> false"""
|
||||
code, out, err = self.t(('calc', 'today==now'))
|
||||
self.assertIn('false', 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