本文整理汇总了Python中nxdrive.engine.activity.Action.export方法的典型用法代码示例。如果您正苦于以下问题:Python Action.export方法的具体用法?Python Action.export怎么用?Python Action.export使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类nxdrive.engine.activity.Action
的用法示例。
在下文中一共展示了Action.export方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_action
# 需要导入模块: from nxdrive.engine.activity import Action [as 别名]
# 或者: from nxdrive.engine.activity.Action import export [as 别名]
def test_action():
action = Action("Testing")
assert action.type == "Testing"
assert repr(action)
assert "%" not in repr(action)
actions = Action.get_actions()
assert len(actions) == 1
assert list(actions.values())[0] == action
assert Action.get_current_action() == action
# Will test .get_percent()
details = action.export()
assert details["last_transfer"] == "Testing"
assert details["progress"] == 0.0
assert isinstance(details["uid"], str)
Action.finish_action()
actions = Action.get_actions()
assert len(actions) == 0
assert Action.get_current_action() is None
示例2: test_action_with_values
# 需要导入模块: from nxdrive.engine.activity import Action [as 别名]
# 或者: from nxdrive.engine.activity.Action import export [as 别名]
def test_action_with_values():
action = Action(action_type="Trying", progress=42.222)
assert "%" in repr(action)
details = action.export()
assert details["progress"] == 42.222
Action.finish_action()