Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1259)

Unified Diff: third_party/twisted_8_1/twisted/trial/test/test_keyboard.py

Issue 12261012: Remove third_party/twisted_8_1 (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/tools/build
Patch Set: Created 7 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: third_party/twisted_8_1/twisted/trial/test/test_keyboard.py
diff --git a/third_party/twisted_8_1/twisted/trial/test/test_keyboard.py b/third_party/twisted_8_1/twisted/trial/test/test_keyboard.py
deleted file mode 100644
index 78f3f6539d3ac53e55f9120c11dc2e7c8c4c54fb..0000000000000000000000000000000000000000
--- a/third_party/twisted_8_1/twisted/trial/test/test_keyboard.py
+++ /dev/null
@@ -1,113 +0,0 @@
-import StringIO
-from twisted.trial import unittest
-from twisted.trial import reporter, runner
-
-
-class TrialTest(unittest.TestCase):
- def setUp(self):
- self.output = StringIO.StringIO()
- self.reporter = reporter.TestResult()
- self.loader = runner.TestLoader()
-
-
-class TestInterruptInTest(TrialTest):
- class InterruptedTest(unittest.TestCase):
- def test_02_raiseInterrupt(self):
- raise KeyboardInterrupt
-
- def test_01_doNothing(self):
- pass
-
- def test_03_doNothing(self):
- TestInterruptInTest.test_03_doNothing_run = True
-
- def setUp(self):
- super(TestInterruptInTest, self).setUp()
- self.suite = self.loader.loadClass(TestInterruptInTest.InterruptedTest)
- TestInterruptInTest.test_03_doNothing_run = None
-
- def test_setUpOK(self):
- self.failUnlessEqual(3, self.suite.countTestCases())
- self.failUnlessEqual(0, self.reporter.testsRun)
- self.failIf(self.reporter.shouldStop)
-
- def test_interruptInTest(self):
- runner.TrialSuite([self.suite]).run(self.reporter)
- self.failUnless(self.reporter.shouldStop)
- self.failUnlessEqual(2, self.reporter.testsRun)
- self.failIf(TestInterruptInTest.test_03_doNothing_run,
- "test_03_doNothing ran.")
-
-
-class TestInterruptInSetUp(TrialTest):
- testsRun = 0
-
- class InterruptedTest(unittest.TestCase):
- def setUp(self):
- if TestInterruptInSetUp.testsRun > 0:
- raise KeyboardInterrupt
-
- def test_01(self):
- TestInterruptInSetUp.testsRun += 1
-
- def test_02(self):
- TestInterruptInSetUp.testsRun += 1
- TestInterruptInSetUp.test_02_run = True
-
- def setUp(self):
- super(TestInterruptInSetUp, self).setUp()
- self.suite = self.loader.loadClass(
- TestInterruptInSetUp.InterruptedTest)
- TestInterruptInSetUp.test_02_run = False
- TestInterruptInSetUp.testsRun = 0
-
- def test_setUpOK(self):
- self.failUnlessEqual(0, TestInterruptInSetUp.testsRun)
- self.failUnlessEqual(2, self.suite.countTestCases())
- self.failUnlessEqual(0, self.reporter.testsRun)
- self.failIf(self.reporter.shouldStop)
-
- def test_interruptInSetUp(self):
- runner.TrialSuite([self.suite]).run(self.reporter)
- self.failUnless(self.reporter.shouldStop)
- self.failUnlessEqual(2, self.reporter.testsRun)
- self.failIf(TestInterruptInSetUp.test_02_run,
- "test_02 ran")
-
-
-class TestInterruptInTearDown(TrialTest):
- testsRun = 0
-
- class InterruptedTest(unittest.TestCase):
- def tearDown(self):
- if TestInterruptInTearDown.testsRun > 0:
- raise KeyboardInterrupt
-
- def test_01(self):
- TestInterruptInTearDown.testsRun += 1
-
- def test_02(self):
- TestInterruptInTearDown.testsRun += 1
- TestInterruptInTearDown.test_02_run = True
-
- def setUp(self):
- super(TestInterruptInTearDown, self).setUp()
- self.suite = self.loader.loadClass(
- TestInterruptInTearDown.InterruptedTest)
- TestInterruptInTearDown.testsRun = 0
- TestInterruptInTearDown.test_02_run = False
-
- def test_setUpOK(self):
- self.failUnlessEqual(0, TestInterruptInTearDown.testsRun)
- self.failUnlessEqual(2, self.suite.countTestCases())
- self.failUnlessEqual(0, self.reporter.testsRun)
- self.failIf(self.reporter.shouldStop)
-
- def test_interruptInTearDown(self):
- runner.TrialSuite([self.suite]).run(self.reporter)
- self.failUnlessEqual(1, self.reporter.testsRun)
- self.failUnless(self.reporter.shouldStop)
- self.failIf(TestInterruptInTearDown.test_02_run,
- "test_02 ran")
-
-
« no previous file with comments | « third_party/twisted_8_1/twisted/trial/test/test_doctest.py ('k') | third_party/twisted_8_1/twisted/trial/test/test_loader.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698