Example #1
0
    def test_time(self):
        """ test_time
        Test 5 second delay
        """
        now = time.time()
        pause.seconds(5)
        end = time.time()

        # True if 5 seconds have passed
        diff = int(end - now)
        self.assertEqual(diff, 5)
Example #2
0
    def test_time(self):
        """ test_time
        Test 5 second delay
        """
        now = time.time()
        pause.seconds(5)
        end = time.time()

        # True if 5 seconds have passed
        diff = int(end - now)
        self.assertEqual(diff, 5)
Example #3
0
    def test_past(self):
        """ test_past
        Test a time that has already passed
        """

        # Using seconds()
        start = time.time()
        pause.seconds(-5)
        end = time.time()
        self.assertEqual(int(end - start), 0)

        # Using until()
        start = time.time()
        pause.until(time.time() - 10)
        end = time.time()
        self.assertEqual(int(end - start), 0)
Example #4
0
    def test_past(self):
        """ test_past
        Test a time that has already passed
        """

        # Using seconds()
        start = time.time()
        pause.seconds(-5)
        end = time.time()
        self.assertEqual(int(end - start), 0)

        # Using until()
        start = time.time()
        pause.until(time.time() - 10)
        end = time.time()
        self.assertEqual(int(end - start), 0)