~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/blackbox/test_breakin.py

  • Committer: Canonical.com Patch Queue Manager
  • Date: 2011-05-20 11:07:31 UTC
  • mfrom: (5340.12.29 2.4-613247-test-cases)
  • Revision ID: pqm@pqm.ubuntu.com-20110520110731-8slefcqat6dr3asl
(jameinel) Bug #613247,
 clean up a bunch of test cases to avoid putting 'self' in the reference
 cycle. (John A Meinel)

Show diffs side-by-side

added added

removed removed

Lines of Context:
42
42
    def setUp(self):
43
43
        super(TestBreakin, self).setUp()
44
44
        self.requireFeature(tests.BreakinFeature)
45
 
        if sys.platform == 'win32':
46
 
            self._send_signal = self._send_signal_win32
47
 
        else:
48
 
            self._send_signal = self._send_signal_via_kill
49
45
 
50
46
    def _send_signal_via_kill(self, pid, sig_type):
51
47
        if sig_type == 'break':
89
85
            exit_code = breakin.determine_signal()
90
86
            ctypes.windll.kernel32.TerminateProcess(pid, exit_code)
91
87
 
 
88
    if sys.platform == 'win32':
 
89
        _send_signal = _send_signal_win32
 
90
    else:
 
91
        _send_signal = _send_signal_via_kill
 
92
 
92
93
    def _popen(self, *args, **kwargs):
93
94
        if sys.platform == 'win32':
94
95
            CREATE_NEW_PROCESS_GROUP = 512