mirror of
https://github.com/GothenburgBitFactory/taskwarrior.git
synced 2025-06-26 10:54:26 +02:00
Tests: Add coverage for TW-1452
This commit is contained in:
parent
f32c4d1f73
commit
c664d62c2f
1 changed files with 43 additions and 0 deletions
43
test/tw-1452.t
Executable file
43
test/tw-1452.t
Executable file
|
@ -0,0 +1,43 @@
|
|||
#!/usr/bin/env python2.7
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
import json
|
||||
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 Test1481(TestCase):
|
||||
def setUp(self):
|
||||
self.t = Task()
|
||||
self.t(('add', 'task'))
|
||||
self.task_uuid = json.loads(self.t(('1', 'export'))[1].strip())['uuid']
|
||||
|
||||
def test_get_task_by_uuid_with_prefix(self):
|
||||
"""Tries to filter task simply by it's uuid, using uuid: prefix."""
|
||||
|
||||
# Load task
|
||||
output = self.t(('uuid:%s' % self.task_uuid, 'export'))[1]
|
||||
|
||||
# Sanity check it is the correct one
|
||||
self.assertEqual(json.loads(output.strip())['uuid'], self.task_uuid)
|
||||
|
||||
def test_get_task_by_uuid_without_prefix(self):
|
||||
"""Tries to filter task simply by it's uuid, without using uuid: prefix."""
|
||||
|
||||
# Load task
|
||||
output = self.t((self.task_uuid, 'export'))[1]
|
||||
|
||||
# Sanity check it is the correct one
|
||||
self.assertEqual(json.loads(output.strip())['uuid'], self.task_uuid)
|
||||
|
||||
|
||||
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