mirror of
https://github.com/GothenburgBitFactory/timewarrior.git
synced 2025-07-07 20:06:39 +02:00
Add sleep to fix clock test
This commit is contained in:
parent
fa129345a5
commit
f843b6e732
1 changed files with 6 additions and 2 deletions
|
@ -30,6 +30,8 @@ import os
|
|||
import sys
|
||||
import unittest
|
||||
|
||||
from time import sleep
|
||||
|
||||
# Ensure python finds the local simpletap module
|
||||
sys.path.append(os.path.dirname(os.path.abspath(__file__)))
|
||||
|
||||
|
@ -86,6 +88,8 @@ class TestClock(TestCase):
|
|||
code, out, err = self.t("start tag1 tag2")
|
||||
self.assertIn("Tracking tag1 tag2\n", out)
|
||||
|
||||
sleep(1)
|
||||
|
||||
code, out, err = self.t("start tag3")
|
||||
self.assertIn("Recorded tag1 tag2\n", out)
|
||||
self.assertIn("Tracking tag3\n", out)
|
||||
|
@ -93,8 +97,8 @@ class TestClock(TestCase):
|
|||
j = self.t.export()
|
||||
|
||||
self.assertEquals(len(j), 2)
|
||||
self.assertClosedInterval(j[1], expectedTags=["tag1", "tag2"])
|
||||
self.assertOpenInterval(j[0], expectedTags=["tag3"])
|
||||
self.assertClosedInterval(j[0], expectedTags=["tag1", "tag2"])
|
||||
self.assertOpenInterval(j[1], expectedTags=["tag3"])
|
||||
|
||||
def test_start_subtract(self):
|
||||
"""Verify that starting multiple tags and stopping one leaves an open interval"""
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue