本文整理汇总了Python中gstswitch.server.Server.gcov_flush方法的典型用法代码示例。如果您正苦于以下问题:Python Server.gcov_flush方法的具体用法?Python Server.gcov_flush怎么用?Python Server.gcov_flush使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类gstswitch.server.Server
的用法示例。
在下文中一共展示了Server.gcov_flush方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_gcov_flush_fail
# 需要导入模块: from gstswitch.server import Server [as 别名]
# 或者: from gstswitch.server.Server import gcov_flush [as 别名]
def test_gcov_flush_fail(self):
"""Test when gcov_flush fails"""
serv = Server(path=PATH)
serv.proc = 1
serv.pid = -300
with pytest.raises(ServerProcessError):
serv.gcov_flush()
示例2: test_gov_flush_fail
# 需要导入模块: from gstswitch.server import Server [as 别名]
# 或者: from gstswitch.server.Server import gcov_flush [as 别名]
def test_gov_flush_fail(self):
"""Test when gov_flush fails"""
serv = Server(path=PATH)
serv.proc = Mock(ProcessMonitor)
serv.proc.send_signal.side_effect = OSError
with pytest.raises(ServerProcessError):
serv.gcov_flush()
示例3: test_normal_gcov_flush
# 需要导入模块: from gstswitch.server import Server [as 别名]
# 或者: from gstswitch.server.Server import gcov_flush [as 别名]
def test_normal_gcov_flush(self, monkeypatch):
"""Test gcov_flush"""
serv = Server(path='abc')
serv.proc = Mock()
monkeypatch.setattr(os, 'kill', Mock())
res = serv.gcov_flush()
assert res is True
assert serv.proc is not None
示例4: test_terminate_cov
# 需要导入模块: from gstswitch.server import Server [as 别名]
# 或者: from gstswitch.server.Server import gcov_flush [as 别名]
def test_terminate_cov(self):
"""Test terminate and gcov_flush ServerProcessError"""
serv = Server(path='abc')
serv.proc = MockProcess(False)
serv.gcov_flush = Mock()
serv.make_coverage = Mock()
with pytest.raises(ServerProcessError):
serv.terminate(True)
示例5: test_kill_cov
# 需要导入模块: from gstswitch.server import Server [as 别名]
# 或者: from gstswitch.server.Server import gcov_flush [as 别名]
def test_kill_cov(self, monkeypatch):
"""Test kill and gcov_flush ServerProcessError"""
serv = Server(path='abc')
serv.proc = MockProcess(False)
serv.gcov_flush = Mock()
serv.make_coverage = Mock()
monkeypatch.setattr(os, 'kill', Mock(side_effect=OSError))
with pytest.raises(ServerProcessError):
serv.kill(True)
示例6: test_no_process_gov_flush
# 需要导入模块: from gstswitch.server import Server [as 别名]
# 或者: from gstswitch.server.Server import gcov_flush [as 别名]
def test_no_process_gov_flush(self):
"""Test when no process exists and gcov_flush is called"""
serv = Server(path=PATH)
with pytest.raises(ServerProcessError):
serv.gcov_flush()