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


Python Executive.kill_all方法代码示例

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


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

示例1: test_kill_all

# 需要导入模块: from webkitpy.common.system.executive import Executive [as 别名]
# 或者: from webkitpy.common.system.executive.Executive import kill_all [as 别名]
 def test_kill_all(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_all("yes")
     self.assertEqual(process.wait(), -signal.SIGTERM)
     # Killing again should fail silently.
     executive.kill_all("yes")
开发者ID:UIKit0,项目名称:WebkitAIR,代码行数:12,代码来源:executive_unittest.py

示例2: test_kill_all

# 需要导入模块: from webkitpy.common.system.executive import Executive [as 别名]
# 或者: from webkitpy.common.system.executive.Executive import kill_all [as 别名]
 def test_kill_all(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_all("yes")
     # Note: Can't use a ternary since signal.SIGTERM is undefined for sys.platform == "win32"
     if sys.platform in ("win32", "cygwin"):
         expected_exit_code = 0  # taskkill.exe results in exit(0)
     else:
         expected_exit_code = -signal.SIGTERM
     self.assertEqual(process.wait(), expected_exit_code)
     # Killing again should fail silently.
     executive.kill_all("yes")
开发者ID:,项目名称:,代码行数:16,代码来源:

示例3: test_kill_all

# 需要导入模块: from webkitpy.common.system.executive import Executive [as 别名]
# 或者: from webkitpy.common.system.executive.Executive import kill_all [as 别名]
 def test_kill_all(self):
     executive = Executive()
     # We use "yes" because it loops forever.
     process = subprocess.Popen(never_ending_command(), stdout=subprocess.PIPE)
     self.assertEqual(process.poll(), None)  # Process is running
     executive.kill_all(never_ending_command()[0])
     # Note: Can't use a ternary since signal.SIGTERM is undefined for sys.platform == "win32"
     if sys.platform == "cygwin":
         expected_exit_code = 0  # os.kill results in exit(0) for this process.
     elif sys.platform == "win32":
         expected_exit_code = 1
     else:
         expected_exit_code = -signal.SIGTERM
     self.assertEqual(process.wait(), expected_exit_code)
     # Killing again should fail silently.
     executive.kill_all(never_ending_command()[0])
开发者ID:Andersbakken,项目名称:check-coding-style,代码行数:18,代码来源:executive_unittest.py

示例4: serial_test_kill_all

# 需要导入模块: from webkitpy.common.system.executive import Executive [as 别名]
# 或者: from webkitpy.common.system.executive.Executive import kill_all [as 别名]
 def serial_test_kill_all(self):
     executive = Executive()
     process = subprocess.Popen(never_ending_command(), stdout=subprocess.PIPE)
     self.assertIsNone(process.poll())  # Process is running
     executive.kill_all(never_ending_command()[0])
     # Note: Can't use a ternary since signal.SIGTERM is undefined for sys.platform == "win32"
     if sys.platform == "cygwin":
         expected_exit_code = 0  # os.kill results in exit(0) for this process.
         self.assertEqual(process.wait(), expected_exit_code)
     elif 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))
     else:
         expected_exit_code = -signal.SIGTERM
         self.assertEqual(process.wait(), expected_exit_code)
     # Killing again should fail silently.
     executive.kill_all(never_ending_command()[0])
开发者ID:cheekiatng,项目名称:webkit,代码行数:20,代码来源:executive_unittest.py


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