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


Python Dart.get_workflow方法代码示例

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


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

示例1: TestWorkflowCrud

# 需要导入模块: from dart.client.python.dart_client import Dart [as 别名]
# 或者: from dart.client.python.dart_client.Dart import get_workflow [as 别名]
class TestWorkflowCrud(unittest.TestCase):
    def setUp(self):
        self.dart = Dart(host='localhost', port=5000)
        args = {'action_sleep_time_in_seconds': 0}
        dst = Datastore(data=DatastoreData('test-datastore', 'no_op_engine', args=args, state=DatastoreState.ACTIVE))
        self.datastore = self.dart.save_datastore(dst)

    def tearDown(self):
        self.dart.delete_datastore(self.datastore.id)

    def test_crud(self):
        wf = Workflow(data=WorkflowData('test-workflow', self.datastore.id, engine_name='no_op_engine'))
        posted_wf = self.dart.save_workflow(wf, self.datastore.id)
        self.assertEqual(posted_wf.data.to_dict(), wf.data.to_dict())

        workflow = self.dart.get_workflow(posted_wf.id)
        self.assertEqual(posted_wf.to_dict(), workflow.to_dict())

        workflow.data.concurrency = 2
        workflow.data.state = WorkflowState.ACTIVE
        put_workflow = self.dart.save_workflow(workflow)
        # not all properties can be modified
        self.assertEqual(put_workflow.data.concurrency, 1)
        self.assertEqual(put_workflow.data.state, WorkflowState.ACTIVE)
        self.assertNotEqual(posted_wf.to_dict(), put_workflow.to_dict())

        self.dart.delete_workflow(workflow.id)
        try:
            self.dart.get_workflow(workflow.id)
        except DartRequestException as e:
            self.assertEqual(e.response.status_code, 404)
            return

        self.fail('workflow should have been missing after delete!')
开发者ID:chrisborg,项目名称:dart,代码行数:36,代码来源:test_workflow.py

示例2: Dart

# 需要导入模块: from dart.client.python.dart_client import Dart [as 别名]
# 或者: from dart.client.python.dart_client.Dart import get_workflow [as 别名]
from dart.client.python.dart_client import Dart
from dart.model.workflow import Workflow, WorkflowState

if __name__ == '__main__':
    dart = Dart('localhost', 5000)
    assert isinstance(dart, Dart)

    workflow = dart.get_workflow('456SGU4U6T')
    assert isinstance(workflow, Workflow)

    workflow.data.state = WorkflowState.INACTIVE
    dart.save_workflow(workflow)
开发者ID:RetailMeNotSandbox,项目名称:dart,代码行数:14,代码来源:inactivate_workflow.py

示例3: Dart

# 需要导入模块: from dart.client.python.dart_client import Dart [as 别名]
# 或者: from dart.client.python.dart_client.Dart import get_workflow [as 别名]
from dart.client.python.dart_client import Dart
from dart.model.workflow import Workflow, WorkflowState

if __name__ == '__main__':
    dart = Dart('localhost', 5000)
    assert isinstance(dart, Dart)

    workflow = dart.get_workflow('86KJA8TAA9')
    assert isinstance(workflow, Workflow)

    workflow.data.state = WorkflowState.ACTIVE
    dart.save_workflow(workflow)
开发者ID:RetailMeNotSandbox,项目名称:dart,代码行数:14,代码来源:activate_workflow.py


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