本文整理匯總了Python中radical.entk.Pipeline.state方法的典型用法代碼示例。如果您正苦於以下問題:Python Pipeline.state方法的具體用法?Python Pipeline.state怎麽用?Python Pipeline.state使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類radical.entk.Pipeline
的用法示例。
在下文中一共展示了Pipeline.state方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: test_pipeline_state_assignment
# 需要導入模塊: from radical.entk import Pipeline [as 別名]
# 或者: from radical.entk.Pipeline import state [as 別名]
def test_pipeline_state_assignment(t, l, i, b):
p = Pipeline()
data_type = [l, i, b]
for data in data_type:
with pytest.raises(TypeError):
p.state = data
if isinstance(t,str):
with pytest.raises(ValueError):
p.state = t
for val in states._pipeline_state_values.keys():
p.state = val
示例2: test_pipeline_suspend_resume
# 需要導入模塊: from radical.entk import Pipeline [as 別名]
# 或者: from radical.entk.Pipeline import state [as 別名]
def test_pipeline_suspend_resume():
p = Pipeline()
assert p.state == states.INITIAL
p.suspend()
assert p.state == states.SUSPENDED
p.resume()
assert p.state == states.INITIAL
p.state = states.SCHEDULING
assert p.state == states.SCHEDULING
p.suspend()
assert p.state == states.SUSPENDED
p.resume()
assert p.state == states.SCHEDULING
with pytest.raises(EnTKError):
p.resume()
p.suspend()
with pytest.raises(EnTKError):
p.suspend()