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


Python Mocker.order方法代码示例

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


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

示例1: test_ChangeIndentationController_save_options

# 需要导入模块: from mocker import Mocker [as 别名]
# 或者: from mocker.Mocker import order [as 别名]
def test_ChangeIndentationController_save_options():
    m = Mocker()
    tv = m.mock(TextView)
    dv = tv.doc_view >> m.mock(TextDocumentView)
    with m.order():
        mode = dv.indent_mode >> "<indent mode>"
        size = dv.indent_size >> "<indent size>"
    with m:
        ctl = ChangeIndentationController.create_with_textview(tv)
        ctl.save_options()
开发者ID:youngrok,项目名称:editxt,代码行数:12,代码来源:test_changeindent.py

示例2: test

# 需要导入模块: from mocker import Mocker [as 别名]
# 或者: from mocker.Mocker import order [as 别名]
 def test(args=()):
     with test_app() as ac:
         m = Mocker()
         ed_class = m.replace(window, 'Window')
         ed = ed_class(ac, args[0] if args else None) >> m.mock(window.Window)
         with m.order():
             ac.windows.append(ed)
             ed.show(ac)
         with m:
             result = ac.create_window(*args)
             eq_(result, ed)
开发者ID:editxt,项目名称:editxt,代码行数:13,代码来源:test_application.py

示例3: test

# 需要导入模块: from mocker import Mocker [as 别名]
# 或者: from mocker.Mocker import order [as 别名]
 def test(args):
     ac = Application()
     m = Mocker()
     ed_class = m.replace(editor, 'Editor')
     wc_class = m.replace(editor, 'EditorWindowController')
     wc = wc_class.alloc() >> m.mock(editor.EditorWindowController)
     wc.initWithWindowNibName_("EditorWindow") >> wc
     ed = ed_class(ac, wc, args[0] if args else None) >> m.mock(editor.Editor)
     wc.editor = ed
     #ed = wc.controller >> m.mock(Editor)
     #wc_class.create_with_serial_data(args[0] if args else None) >> wc
     with m.order():
         ac.editors.append(ed)
         wc.showWindow_(ac)
     with m:
         result = ac.create_editor(*args)
         eq_(result, ed)
开发者ID:khairy,项目名称:editxt,代码行数:19,代码来源:test_application.py

示例4: test_wait_for_presence_works_even_when_is_visible_raises

# 需要导入模块: from mocker import Mocker [as 别名]
# 或者: from mocker.Mocker import order [as 别名]
def test_wait_for_presence_works_even_when_is_visible_raises():
    
    mocker = Mocker()
    
    context = Context(Settings())
    selenium_mock = mocker.mock()
    selenium_mock.is_element_present('some element')
    mocker.count(min=1, max=None)
    mocker.result(True)
    
    with mocker.order():
        selenium_mock.is_visible('some element')
        mocker.throw(Exception("ERROR: Element some element not found"))
        selenium_mock.is_visible('some element')
        mocker.result(True)

    with mocker:
        driver = SeleniumDriver(context, selenium=selenium_mock)
        driver.wait_for_element_present("some element", 1)
开发者ID:Desperado,项目名称:pyccuracy,代码行数:21,代码来源:test_selenium_browser_driver.py


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