当前位置: 首页>>代码示例>>Python>>正文


Python Executive.kill_process方法代码示例

本文整理汇总了Python中webkitpy.common.system.executive.Executive.kill_process方法的典型用法代码示例。如果您正苦于以下问题:Python Executive.kill_process方法的具体用法?Python Executive.kill_process怎么用?Python Executive.kill_process使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在webkitpy.common.system.executive.Executive的用法示例。


在下文中一共展示了Executive.kill_process方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: test_kill_process

# 需要导入模块: from webkitpy.common.system.executive import Executive [as 别名]
# 或者: from webkitpy.common.system.executive.Executive import kill_process [as 别名]
    def test_kill_process(self):
        executive = Executive()
        process = subprocess.Popen(never_ending_command(), stdout=subprocess.PIPE)
        self.assertEqual(process.poll(), None)  # Process is running
        executive.kill_process(process.pid)

        # Killing again should fail silently.
        executive.kill_process(process.pid)
开发者ID:b-cuts,项目名称:blink-crosswalk,代码行数:10,代码来源:executive_unittest.py

示例2: test_kill_process

# 需要导入模块: from webkitpy.common.system.executive import Executive [as 别名]
# 或者: from webkitpy.common.system.executive.Executive import kill_process [as 别名]
 def test_kill_process(self):
     executive = Executive()
     # FIXME: This may need edits to work right on windows.
     # We use "yes" because it loops forever.
     process = subprocess.Popen(["yes"], stdout=subprocess.PIPE)
     self.assertEqual(process.poll(), None)  # Process is running
     executive.kill_process(process.pid)
     self.assertEqual(process.wait(), -signal.SIGKILL)
     # Killing again should fail silently.
     executive.kill_process(process.pid)
开发者ID:UIKit0,项目名称:WebkitAIR,代码行数:12,代码来源:executive_unittest.py

示例3: serial_test_kill_process

# 需要导入模块: from webkitpy.common.system.executive import Executive [as 别名]
# 或者: from webkitpy.common.system.executive.Executive import kill_process [as 别名]
    def serial_test_kill_process(self):
        if sys.platform in ("win32", "cygwin"):
            return  # Windows does not return consistent exit codes.

        executive = Executive()
        process = subprocess.Popen(never_ending_command(), stdout=subprocess.PIPE)
        self.assertEqual(process.poll(), None)  # Process is running
        executive.kill_process(process.pid)
        self.assertEqual(process.wait(), -signal.SIGKILL)

        # Killing again should fail silently.
        executive.kill_process(process.pid)
开发者ID:Drakey83,项目名称:steamlink-sdk,代码行数:14,代码来源:executive_unittest.py

示例4: test_kill_process

# 需要导入模块: from webkitpy.common.system.executive import Executive [as 别名]
# 或者: from webkitpy.common.system.executive.Executive import kill_process [as 别名]
 def test_kill_process(self):
     executive = Executive()
     process = subprocess.Popen(never_ending_command(), stdout=subprocess.PIPE)
     self.assertEqual(process.poll(), None)  # Process is running
     executive.kill_process(process.pid)
     # Note: Can't use a ternary since signal.SIGKILL is undefined for sys.platform == "win32"
     if sys.platform == "win32":
         expected_exit_code = 1
     else:
         expected_exit_code = -signal.SIGKILL
     self.assertEqual(process.wait(), expected_exit_code)
     # Killing again should fail silently.
     executive.kill_process(process.pid)
开发者ID:Andersbakken,项目名称:check-coding-style,代码行数:15,代码来源:executive_unittest.py

示例5: test_kill_process

# 需要导入模块: from webkitpy.common.system.executive import Executive [as 别名]
# 或者: from webkitpy.common.system.executive.Executive import kill_process [as 别名]
 def test_kill_process(self):
     executive = Executive()
     # We use "yes" because it loops forever.
     process = subprocess.Popen(["yes"], stdout=subprocess.PIPE)
     self.assertEqual(process.poll(), None)  # Process is running
     executive.kill_process(process.pid)
     # Note: Can't use a ternary since signal.SIGKILL is undefined for sys.platform == "win32"
     if sys.platform == "win32":
         expected_exit_code = 0  # taskkill.exe results in exit(0)
     else:
         expected_exit_code = -signal.SIGKILL
     self.assertEqual(process.wait(), expected_exit_code)
     # Killing again should fail silently.
     executive.kill_process(process.pid)
开发者ID:,项目名称:,代码行数:16,代码来源:

示例6: test_kill_process

# 需要导入模块: from webkitpy.common.system.executive import Executive [as 别名]
# 或者: from webkitpy.common.system.executive.Executive import kill_process [as 别名]
 def test_kill_process(self):
     executive = Executive()
     process = subprocess.Popen(never_ending_command(), stdout=subprocess.PIPE)
     self.assertEqual(process.poll(), None)  # Process is running
     executive.kill_process(process.pid)
     # Note: Can't use a ternary since signal.SIGKILL is undefined for sys.platform == "win32"
     if sys.platform == "win32":
         # FIXME: https://bugs.webkit.org/show_bug.cgi?id=54790
         # We seem to get either 0 or 1 here for some reason.
         self.assertTrue(process.wait() in (0, 1))
     else:
         expected_exit_code = -signal.SIGKILL
         self.assertEqual(process.wait(), expected_exit_code)
     # Killing again should fail silently.
     executive.kill_process(process.pid)
开发者ID:dzhshf,项目名称:WebKit,代码行数:17,代码来源:executive_unittest.py

示例7: serial_test_kill_process

# 需要导入模块: from webkitpy.common.system.executive import Executive [as 别名]
# 或者: from webkitpy.common.system.executive.Executive import kill_process [as 别名]
    def serial_test_kill_process(self):
        executive = Executive()
        process = subprocess.Popen(never_ending_command(), stdout=subprocess.PIPE)
        self.assertEqual(process.poll(), None)  # Process is running
        executive.kill_process(process.pid)
        # Note: Can't use a ternary since signal.SIGKILL is undefined for sys.platform == "win32"
        if sys.platform == "win32":
            # FIXME: https://bugs.webkit.org/show_bug.cgi?id=54790
            # We seem to get either 0 or 1 here for some reason.
            self.assertIn(process.wait(), (0, 1))
        elif sys.platform == "cygwin":
            # FIXME: https://bugs.webkit.org/show_bug.cgi?id=98196
            # cygwin seems to give us either SIGABRT or SIGKILL
            # Native Windows (via Cygwin) returns ENOTBLK (-15)
            self.assertIn(process.wait(), (-signal.SIGABRT, -signal.SIGKILL, -15))
        else:
            expected_exit_code = -signal.SIGTERM
            self.assertEqual(process.wait(), expected_exit_code)

        # Killing again should fail silently.
        executive.kill_process(process.pid)
开发者ID:cheekiatng,项目名称:webkit,代码行数:23,代码来源:executive_unittest.py


注:本文中的webkitpy.common.system.executive.Executive.kill_process方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。