2 # Copyright (C) 2019 EfficiOS Inc.
4 # This program is free software; you can redistribute it and/or
5 # modify it under the terms of the GNU General Public License
6 # as published by the Free Software Foundation; only version 2
9 # This program is distributed in the hope that it will be useful,
10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 # GNU General Public License for more details.
14 # You should have received a copy of the GNU General Public License
15 # along with this program; if not, write to the Free Software
16 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
23 class InterrupterTestCase(unittest
.TestCase
):
25 self
._interrupter
= bt2
.Interrupter()
27 def test_create(self
):
28 self
.assertFalse(self
._interrupter
.is_set
)
30 def test_is_set(self
):
31 self
.assertFalse(self
._interrupter
.is_set
)
34 self
.assertFalse(self
._interrupter
)
35 self
._interrupter
.set()
36 self
.assertTrue(self
._interrupter
)
39 self
.assertFalse(self
._interrupter
)
40 self
._interrupter
.set()
41 self
.assertTrue(self
._interrupter
)
44 self
._interrupter
.set()
45 self
.assertTrue(self
._interrupter
)
46 self
._interrupter
.reset()
47 self
.assertFalse(self
._interrupter
)
This page took 0.030404 seconds and 4 git commands to generate.