• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Python utils.fabfile函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Python中utils.fabfile函数的典型用法代码示例。如果您正苦于以下问题:Python fabfile函数的具体用法?Python fabfile怎么用?Python fabfile使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



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

示例1: test_flat_alias

 def test_flat_alias(self):
     f = fabfile("flat_alias.py")
     with path_prefix(f):
         docs, funcs = load_fabfile(f)
         eq_(len(funcs), 2)
         ok_("foo" in funcs)
         ok_("foo_aliased" in funcs)
开发者ID:5minutes,项目名称:fabric,代码行数:7,代码来源:test_main.py


示例2: test_nested_alias

 def test_nested_alias(self):
     f = fabfile("nested_alias.py")
     with path_prefix(f):
         docs, funcs = load_fabfile(f)
         ok_("nested" in funcs)
         eq_(len(funcs["nested"]), 2)
         ok_("foo" in funcs["nested"])
         ok_("foo_aliased" in funcs["nested"])
开发者ID:5minutes,项目名称:fabric,代码行数:8,代码来源:test_main.py


示例3: test_task_decorator_plays_well_with_others

 def test_task_decorator_plays_well_with_others(self):
     """
     @task, when inside @hosts/@roles, should not hide the decorated task.
     """
     module = fabfile('decorator_order')
     with path_prefix(module):
         docs, funcs = load_fabfile(module)
         # When broken, crawl() finds None for 'foo' instead.
         eq_(crawl('foo', funcs), funcs['foo'])
开发者ID:5minutes,项目名称:fabric,代码行数:9,代码来源:test_main.py


示例4: test_newstyle_task_presence_skips_classic_task_modules

 def test_newstyle_task_presence_skips_classic_task_modules(self):
     """
     Classic-task-only modules shouldn't add tasks if any new-style tasks exist
     """
     module = fabfile('deep')
     with path_prefix(module):
         docs, funcs = load_fabfile(module)
         eq_(len(funcs), 1)
         ok_('submodule.classic_task' not in _task_names(funcs))
开发者ID:5minutes,项目名称:fabric,代码行数:9,代码来源:test_main.py


示例5: test_recursion_steps_into_nontask_modules

 def test_recursion_steps_into_nontask_modules(self):
     """
     Recursive loading will continue through modules with no tasks
     """
     module = fabfile('deep')
     with path_prefix(module):
         docs, funcs = load_fabfile(module)
         eq_(len(funcs), 1)
         ok_('submodule.subsubmodule.deeptask' in _task_names(funcs))
开发者ID:5minutes,项目名称:fabric,代码行数:9,代码来源:test_main.py


示例6: test_should_load_decorated_tasks_only_if_one_is_found

 def test_should_load_decorated_tasks_only_if_one_is_found(self):
     """
     If any new-style tasks are found, *only* new-style tasks should load
     """
     module = fabfile('decorated_fabfile.py')
     with path_prefix(module):
         docs, funcs = load_fabfile(module)
         eq_(len(funcs), 1)
         ok_('foo' in funcs)
开发者ID:5minutes,项目名称:fabric,代码行数:9,代码来源:test_main.py


示例7: test_class_based_tasks_are_found_with_proper_name

 def test_class_based_tasks_are_found_with_proper_name(self):
     """
     Wrapped new-style tasks should preserve their function names
     """
     module = fabfile('decorated_fabfile_with_classbased_task.py')
     with path_prefix(module):
         docs, funcs = load_fabfile(module)
         eq_(len(funcs), 1)
         ok_('foo' in funcs)
开发者ID:cmattoon,项目名称:fabric,代码行数:9,代码来源:test_main.py


示例8: test_exception_exclusion

 def test_exception_exclusion(self):
     """
     Exception subclasses should not be considered as tasks
     """
     exceptions = fabfile("exceptions_fabfile.py")
     with path_prefix(exceptions):
         docs, funcs = load_fabfile(exceptions)
         ok_("some_task" in funcs)
         ok_("NotATask" not in funcs)
开发者ID:cmattoon,项目名称:fabric,代码行数:9,代码来源:test_main.py


示例9: test_explicit_discovery

 def test_explicit_discovery(self):
     """
     If __all__ is present, only collect the tasks it specifies
     """
     explicit = fabfile("explicit_fabfile.py")
     with path_prefix(explicit):
         docs, funcs = load_fabfile(explicit)
         eq_(len(funcs), 1)
         ok_("foo" in funcs)
         ok_("bar" not in funcs)
开发者ID:5minutes,项目名称:fabric,代码行数:10,代码来源:test_main.py


示例10: test_implicit_discovery

 def test_implicit_discovery(self):
     """
     Default to automatically collecting all tasks in a fabfile module
     """
     implicit = fabfile("implicit_fabfile.py")
     with path_prefix(implicit):
         docs, funcs = load_fabfile(implicit)
         eq_(len(funcs), 2)
         ok_("foo" in funcs)
         ok_("bar" in funcs)
开发者ID:5minutes,项目名称:fabric,代码行数:10,代码来源:test_main.py


示例11: test_class_based_tasks_are_found_with_variable_name

 def test_class_based_tasks_are_found_with_variable_name(self):
     """
     A new-style tasks with undefined name attribute should use the instance
     variable name.
     """
     module = fabfile('classbased_task_fabfile.py')
     with path_prefix(module):
         docs, funcs = load_fabfile(module)
         eq_(len(funcs), 1)
         ok_('foo' in funcs)
         eq_(funcs['foo'].name, 'foo')
开发者ID:cmattoon,项目名称:fabric,代码行数:11,代码来源:test_main.py


示例12: test_class_based_tasks_are_found_with_proper_name

    def test_class_based_tasks_are_found_with_proper_name(self):
        """
        Wrapped new-style tasks should preserve their function names
        """
        module = fabfile("decorated_fabfile_with_classbased_task.py")
        from fabric.state import env

        with path_prefix(module):
            docs, funcs = load_fabfile(module)
            eq_(len(funcs), 1)
            ok_("foo" in funcs)
开发者ID:peterlandry,项目名称:fabric,代码行数:11,代码来源:test_main.py


示例13: test_class_based_tasks_are_found_with_variable_name

    def test_class_based_tasks_are_found_with_variable_name(self):
        """
        A new-style tasks with undefined name attribute should use the instance
        variable name.
        """
        module = fabfile("classbased_task_fabfile.py")
        from fabric.state import env

        with path_prefix(module):
            docs, funcs = load_fabfile(module)
            eq_(len(funcs), 1)
            ok_("foo" in funcs)
            eq_(funcs["foo"].name, "foo")
开发者ID:peterlandry,项目名称:fabric,代码行数:13,代码来源:test_main.py


示例14: test_default_task_loading

def test_default_task_loading():
    """
    crawl() should return default tasks where found, instead of module objs
    """
    docs, tasks = load_fabfile(fabfile('default_tasks'))
    ok_(isinstance(crawl('mymodule', tasks), Task))
开发者ID:5minutes,项目名称:fabric,代码行数:6,代码来源:test_main.py


示例15: list_output

def list_output(module, format_, expected):
    module = fabfile(module)
    with path_prefix(module):
        docstring, tasks = load_fabfile(module)
        with patched_context(fabric.state, 'commands', tasks):
            eq_output(docstring, format_, expected)
开发者ID:5minutes,项目名称:fabric,代码行数:6,代码来源:test_main.py



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Python utils.fail函数代码示例发布时间:2022-05-26
下一篇:
Python utils.extract_nodes函数代码示例发布时间:2022-05-26
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap