Permalink
Browse files

Add sleep to fix clock test

  • Loading branch information...
lauft committed Jan 7, 2019
1 parent fa12934 commit f843b6e732ff35a1d839eda181e1fbdfd8872694
Showing with 6 additions and 2 deletions.
  1. +6 −2 test/clock.t
@@ -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,15 +88,17 @@ 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)

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"""

0 comments on commit f843b6e

Please sign in to comment.