mirror of
https://github.com/qgis/QGIS.git
synced 2025-02-26 00:02:08 -05:00
38 lines
1.3 KiB
Python
38 lines
1.3 KiB
Python
import re
|
|
|
|
from nose2.tests._common import FunctionalTestCase
|
|
|
|
|
|
class TestPrintHooksPlugin(FunctionalTestCase):
|
|
|
|
def test_invocation_by_double_dash_option(self):
|
|
proc = self.runIn(
|
|
'scenario/no_tests',
|
|
'--plugin=nose2.plugins.printhooks',
|
|
'--print-hooks')
|
|
match = re.compile("\n"
|
|
"handleArgs: "
|
|
"CommandLineArgsEvent\(handled=False, args=")
|
|
self.assertTestRunOutputMatches(proc, stderr=match)
|
|
self.assertEqual(proc.poll(), 0)
|
|
|
|
def test_invocation_by_single_dash_option(self):
|
|
proc = self.runIn(
|
|
'scenario/no_tests',
|
|
'--plugin=nose2.plugins.printhooks',
|
|
'-P')
|
|
match = re.compile("\n"
|
|
"handleArgs: "
|
|
"CommandLineArgsEvent\(handled=False, args=")
|
|
self.assertTestRunOutputMatches(proc, stderr=match)
|
|
self.assertEqual(proc.poll(), 0)
|
|
|
|
def test_nested_hooks_are_indented(self):
|
|
proc = self.runIn(
|
|
'scenario/no_tests',
|
|
'--plugin=nose2.plugins.printhooks',
|
|
'--print-hooks')
|
|
match = re.compile("\n handleFile: ")
|
|
self.assertTestRunOutputMatches(proc, stderr=match)
|
|
self.assertEqual(proc.poll(), 0)
|