本文整理汇总了Python中aloe.registry.StepDict.load_steps方法的典型用法代码示例。如果您正苦于以下问题:Python StepDict.load_steps方法的具体用法?Python StepDict.load_steps怎么用?Python StepDict.load_steps使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类aloe.registry.StepDict
的用法示例。
在下文中一共展示了StepDict.load_steps方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_StepDict_can_exclude_methods_when_load_steps
# 需要导入模块: from aloe.registry import StepDict [as 别名]
# 或者: from aloe.registry.StepDict import load_steps [as 别名]
def test_StepDict_can_exclude_methods_when_load_steps():
"""
aloe.STEP_REGISTRY.load_steps(obj) don't load exluded attr in
STEP_REGISTRY
"""
steps = StepDict()
class LotsOfSteps(object):
"""A class defining some steps."""
exclude = ["step_1"]
def step_1(self): # pylint:disable=missing-docstring
pass
def step_2(self):
"""Doing something"""
pass
step_list = LotsOfSteps()
steps.load_steps(step_list)
expected_sentence1 = re.compile("Step 1", re.I | re.U)
expected_sentence2 = re.compile("Doing something", re.I | re.U)
assert_not_in(expected_sentence1, steps)
assert_in(expected_sentence2, steps)
示例2: test_StepDict_can_load_steps_from_an_object
# 需要导入模块: from aloe.registry import StepDict [as 别名]
# 或者: from aloe.registry.StepDict import load_steps [as 别名]
def test_StepDict_can_load_steps_from_an_object():
"""
aloe.STEP_REGISTRY.load_steps(obj) append all obj methods to
STEP_REGISTRY
"""
steps = StepDict()
class LotsOfSteps(object):
"""A class defining some steps."""
def step_1(self): # pylint:disable=missing-docstring
pass
def step_2(self):
"""Doing something"""
pass
step_list = LotsOfSteps()
steps.load_steps(step_list)
expected_sentence1 = re.compile("Step 1", re.I | re.U)
expected_sentence2 = re.compile("Doing something", re.I | re.U)
assert_in(expected_sentence1, steps)
assert_in(expected_sentence2, steps)
assert_equal(steps[expected_sentence1], step_list.step_1)
assert_equal(steps[expected_sentence2], step_list.step_2)
示例3: test_StepDict_can_exclude_callable_object_when_load_steps
# 需要导入模块: from aloe.registry import StepDict [as 别名]
# 或者: from aloe.registry.StepDict import load_steps [as 别名]
def test_StepDict_can_exclude_callable_object_when_load_steps():
"""
aloe.STEP_REGISTRY.load_steps(obj) don't load callable objets in
STEP_REGISTRY
"""
steps = StepDict()
class NoStep(object):
"""A class defining something that's not a step."""
class NotAStep(object):
"""A callable which isn't a step."""
def __call__(self):
pass
no_step = NoStep()
steps.load_steps(no_step)
assert len(steps) == 0
示例4: test_StepDict_can_load_steps_from_an_object
# 需要导入模块: from aloe.registry import StepDict [as 别名]
# 或者: from aloe.registry.StepDict import load_steps [as 别名]
def test_StepDict_can_load_steps_from_an_object():
"""
aloe.STEP_REGISTRY.load_steps(obj) append all obj methods to
STEP_REGISTRY
"""
steps = StepDict()
class LotsOfSteps(object):
"""A class defining some steps."""
def step_1(self): # pylint:disable=missing-docstring
pass
def step_2(self):
"""Doing something"""
pass
step_list = LotsOfSteps()
steps.load_steps(step_list)
assert_matches(steps, "Step 1", (step_list.step_1, (), {}))
assert_matches(steps, "Doing something", (step_list.step_2, (), {}))
示例5: test_StepDict_can_exclude_methods_when_load_steps
# 需要导入模块: from aloe.registry import StepDict [as 别名]
# 或者: from aloe.registry.StepDict import load_steps [as 别名]
def test_StepDict_can_exclude_methods_when_load_steps():
"""
aloe.STEP_REGISTRY.load_steps(obj) don't load exluded attr in
STEP_REGISTRY
"""
steps = StepDict()
class LotsOfSteps(object):
"""A class defining some steps."""
exclude = ["step_1"]
def step_1(self): # pylint:disable=missing-docstring
pass
def step_2(self):
"""Doing something"""
pass
step_list = LotsOfSteps()
steps.load_steps(step_list)
assert_no_match(steps, "Step 1")
assert_matches(steps, "Doing something", (step_list.step_2, (), {}))