mirror of
https://github.com/GothenburgBitFactory/taskwarrior.git
synced 2025-06-26 10:54:26 +02:00
Tests: common/reusable variables live in basetest.utils
This commit is contained in:
parent
d2e6c90446
commit
357850177d
3 changed files with 5 additions and 6 deletions
|
@ -33,7 +33,7 @@ import unittest
|
|||
sys.path.append(os.path.dirname(os.path.abspath(__file__)))
|
||||
|
||||
from basetest import Task, TestCase
|
||||
from basetest.utils import UUID_regex
|
||||
from basetest.utils import UUID_REGEXP
|
||||
|
||||
|
||||
class TestAdd(TestCase):
|
||||
|
@ -49,7 +49,7 @@ class TestAdd(TestCase):
|
|||
self.assertRegexpMatches(out, "ID\s+1\n")
|
||||
self.assertRegexpMatches(out, "Description\s+This is a test\n")
|
||||
self.assertRegexpMatches(out, "Status\s+Pending\n")
|
||||
self.assertRegexpMatches(out, "UUID\s+" + UUID_regex + "\n")
|
||||
self.assertRegexpMatches(out, "UUID\s+" + UUID_REGEXP + "\n")
|
||||
|
||||
def test_modify_slash(self):
|
||||
"Test the /// modifier"
|
||||
|
@ -62,7 +62,7 @@ class TestAdd(TestCase):
|
|||
self.assertRegexpMatches(out, "ID\s+1\n")
|
||||
self.assertRegexpMatches(out, "Status\s+Pending\n")
|
||||
self.assertRegexpMatches(out, "Description\s+This a TEST\n")
|
||||
self.assertRegexpMatches(out, "UUID\s+" + UUID_regex + "\n")
|
||||
self.assertRegexpMatches(out, "UUID\s+" + UUID_REGEXP + "\n")
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
|
|
|
@ -44,7 +44,7 @@ TASKD_SKIP = os.environ.get("TASKD_SKIP", False)
|
|||
TASK_USE_PATH = os.environ.get("TASK_USE_PATH", False)
|
||||
TASKD_USE_PATH = os.environ.get("TASKD_USE_PATH", False)
|
||||
|
||||
UUID_regex = ("[0-9A-Fa-f]{8}-" + ("[0-9A-Fa-f]{4}-" * 3) + "[0-9A-Fa-f]{12}")
|
||||
UUID_REGEXP = ("[0-9A-Fa-f]{8}-" + ("[0-9A-Fa-f]{4}-" * 3) + "[0-9A-Fa-f]{12}")
|
||||
|
||||
|
||||
def task_binary_location(cmd="task"):
|
||||
|
|
|
@ -39,9 +39,8 @@ import unittest
|
|||
sys.path.append(os.path.dirname(os.path.abspath(__file__)))
|
||||
|
||||
from basetest import Task, TestCase
|
||||
from basetest.utils import UUID_REGEXP
|
||||
|
||||
# TODO: Move to common file with all regexpes
|
||||
UUID_REGEXP = r'[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}'
|
||||
DATETIME_FORMAT = "%Y%m%dT%H%M%SZ"
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue