Wei-Yu Chen | ad55cb8 | 2022-02-15 20:07:01 +0800 | [diff] [blame] | 1 | # SPDX-FileCopyrightText: 2020 The Magma Authors. |
| 2 | # SPDX-FileCopyrightText: 2022 Open Networking Foundation <support@opennetworking.org> |
| 3 | # |
| 4 | # SPDX-License-Identifier: BSD-3-Clause |
Wei-Yu Chen | 49950b9 | 2021-11-08 19:19:18 +0800 | [diff] [blame] | 5 | |
| 6 | # pylint: disable=protected-access |
| 7 | from unittest import TestCase |
| 8 | |
| 9 | from state_machines.timer import StateMachineTimer |
| 10 | |
| 11 | |
| 12 | class StateMachineTimerTests(TestCase): |
| 13 | def test_is_done(self): |
| 14 | timer_a = StateMachineTimer(0) |
| 15 | self.assertTrue(timer_a.is_done(), 'Timer should be done') |
| 16 | |
| 17 | timer_b = StateMachineTimer(600) |
| 18 | self.assertFalse(timer_b.is_done(), 'Timer should not be done') |