OXIESEC PANEL
- Current Dir:
/
/
usr
/
lib
/
python3
/
dist-packages
/
twisted
/
_threads
/
test
Server IP: 139.59.38.164
Upload:
Create Dir:
Name
Size
Modified
Perms
📁
..
-
03/31/2022 06:22:38 AM
rwxr-xr-x
📄
__init__.py
226 bytes
09/08/2017 10:38:36 AM
rw-r--r--
📁
__pycache__
-
03/31/2022 06:22:38 AM
rwxr-xr-x
📄
test_convenience.py
1.41 KB
09/08/2017 10:38:36 AM
rw-r--r--
📄
test_memory.py
2.1 KB
09/08/2017 10:38:36 AM
rw-r--r--
📄
test_team.py
9.31 KB
09/08/2017 10:38:36 AM
rw-r--r--
📄
test_threadworker.py
7.9 KB
09/08/2017 10:38:36 AM
rw-r--r--
Editing: test_convenience.py
Close
# Copyright (c) Twisted Matrix Laboratories. # See LICENSE for details. """ Test cases for convenience functionality in L{twisted._threads._convenience}. """ from __future__ import absolute_import, division, print_function from twisted.trial.unittest import SynchronousTestCase from .._convenience import Quit from .._ithreads import AlreadyQuit class QuitTests(SynchronousTestCase): """ Tests for L{Quit} """ def test_isInitiallySet(self): """ L{Quit.isSet} starts as L{False}. """ quit = Quit() self.assertEqual(quit.isSet, False) def test_setSetsSet(self): """ L{Quit.set} sets L{Quit.isSet} to L{True}. """ quit = Quit() quit.set() self.assertEqual(quit.isSet, True) def test_checkDoesNothing(self): """ L{Quit.check} initially does nothing and returns L{None}. """ quit = Quit() self.assertIs(quit.check(), None) def test_checkAfterSetRaises(self): """ L{Quit.check} raises L{AlreadyQuit} if L{Quit.set} has been called. """ quit = Quit() quit.set() self.assertRaises(AlreadyQuit, quit.check) def test_setTwiceRaises(self): """ L{Quit.set} raises L{AlreadyQuit} if it has been called previously. """ quit = Quit() quit.set() self.assertRaises(AlreadyQuit, quit.set)