blob: ad00232a32de77cbc906b53ced3b37c6b524f42a [file] [log] [blame]
Wei-Yu Chen49950b92021-11-08 19:19:18 +08001"""
2Copyright 2020 The Magma Authors.
3
4This source code is licensed under the BSD-style license found in the
5LICENSE file in the root directory of this source tree.
6
7Unless required by applicable law or agreed to in writing, software
8distributed under the License is distributed on an "AS IS" BASIS,
9WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
10See the License for the specific language governing permissions and
11limitations under the License.
12"""
13
14# pylint: disable=protected-access
15from unittest import TestCase
16
17from state_machines.timer import StateMachineTimer
18
19
20class StateMachineTimerTests(TestCase):
21 def test_is_done(self):
22 timer_a = StateMachineTimer(0)
23 self.assertTrue(timer_a.is_done(), 'Timer should be done')
24
25 timer_b = StateMachineTimer(600)
26 self.assertFalse(timer_b.is_done(), 'Timer should not be done')