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


Python asserts.assert_strings_equal函数代码示例

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


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

示例1: display_edited_lines

def display_edited_lines():
	diffmodel = FakeDiffModel()
	diffmodel.lines = [
		DiffLine( "left 01", "right 01", difflinetypes.DIFFERENT, False, True ),
		DiffLine( "left 02", "right 02", difflinetypes.DIFFERENT, True,  True ),
		DiffLine( "left 03", "right 03", difflinetypes.DIFFERENT, True, False ),
		DiffLine( "line 04", "line 04",  difflinetypes.IDENTICAL, False, True ),
		DiffLine( "line 05", "line 05",  difflinetypes.IDENTICAL, True,  True ),
		DiffLine( "line 06", "line 06",  difflinetypes.IDENTICAL, True, False ),
	]

	view = NCursesView( diffmodel )
	view.win_width  = 40
	view.win_height = 6

	actions = []

	assert_strings_equal( view.show( actions )[0],
"""[di]left 01           [ei] * [e]right 01           
left 02           [ei] * [e]right 02           
left 03           [ei] * [d]right 03           
[n]line 04           [ei]   [e]line 04            
line 05           [ei]   [e]line 05            
line 06           [ei]   [n]line 06            
""" )
开发者ID:andybalaam,项目名称:diffident,代码行数:25,代码来源:test_ncursesview_editing.py

示例2: down_emptyfile

def down_emptyfile():
    diffmodel = FakeDiffModel()
    diffmodel.lines = [
        DiffLine(None, "line 1 here", difflinetypes.ADD),
        DiffLine(None, "line 2 here", difflinetypes.ADD),
    ]

    view = NCursesView(diffmodel)
    view.win_width = 40
    view.win_height = 3

    actions = [
        curses.KEY_DOWN,
        curses.KEY_DOWN,
        curses.KEY_DOWN,
        curses.KEY_DOWN,
        curses.KEY_DOWN,
        curses.KEY_DOWN,
        curses.KEY_DOWN,
        curses.KEY_DOWN,
        curses.KEY_DOWN,
        curses.KEY_DOWN,
        curses.KEY_DOWN,
    ]

    assert_strings_equal(
        view.show(actions)[0],
        """[m]..................[ai] + [a]line 1 here        
[mi]..................[ai] + [a]line 2 here        
[n]                                        
""",
    )
开发者ID:andybalaam,项目名称:diffident,代码行数:32,代码来源:test_ncursesview_movement.py

示例3: differences

def differences():

	diffmodel = FakeDiffModel()
	diffmodel.lines = [
		DiffLine( "line 1 here", "line 1 here different",
			difflinetypes.DIFFERENT ),
		DiffLine( "line 2 here", "line 2 here different",
			difflinetypes.DIFFERENT ),
		]

	listview = ListView( diffmodel )

	listview.set_columns( 80 )

	assert_strings_equal( listview.get_string(),
"""line 1 here                            |  line 1 here different
line 2 here                            |  line 2 here different
""" )

	listview.set_columns( 60 )

	assert_strings_equal( listview.get_string(),
"""line 1 here                  |  line 1 here different
line 2 here                  |  line 2 here different
""" )
开发者ID:andybalaam,项目名称:diffident,代码行数:25,代码来源:test_listview.py

示例4: mixture

def mixture():

	diffmodel = FakeDiffModel()
	diffmodel.lines = [
		DiffLine( "line 1 here", "line 1 here", difflinetypes.IDENTICAL ),
		DiffLine( None, "line 2 here",
			difflinetypes.ADD ),
		DiffLine( "line 3 here", "line 3 here", difflinetypes.IDENTICAL ),
		DiffLine( "line 4 here", "line 4 here different",
			difflinetypes.DIFFERENT ),
		DiffLine( "line 5 here", None,
			difflinetypes.REMOVE ),
		DiffLine( "line 6 here", "line 6 here", difflinetypes.IDENTICAL ),
		]

	view = NCursesView( diffmodel )
	view.win_width  = 40
	view.win_height = 5

	actions = []

	assert_strings_equal( view.show( actions )[0],
"""[ni]line 1 here       [n]   line 1 here        
[m]..................[ai] + [a]line 2 here        
[n]line 3 here          line 3 here        
[d]line 4 here       [di] * [d]line 4 here differe
[r]line 5 here       [ri] - [m]...................
""" )
开发者ID:andybalaam,项目名称:diffident,代码行数:28,代码来源:test_ncursesview.py

示例5: normal

def normal():
	view = _make_view()
	actions = [ "H" ]

	assert_strings_equal( view.show( actions )[0],
"""[n]                                                                                
                                 Diffident Help                                 
                                                                                
                                    Quit - q                                    
                         Move left/right - h/l or Arrow Keys                    
                            Move up/down - k/j or Arrow Keys                    
                     Select line up/down - K/J                                  
                Next/Previous difference - n/p or F8/F7                         
                            Page up/down - ,/. or PageUp/Down                   
                     Select page up/down - </>                                  
                       Scroll left/right - z/x                                  
                         Copy left/right - [/]                                  
                             Insert line - a                                    
                          Delete line(s) - d                                    
                            Save changes - s                                    
                                                                                
   Diffident is Copyright (C) 2009 Andy Balaam and the Diffident developers.    
                  Diffident comes with ABSOLUTELY NO WARRANTY.                  
  This is free software, and you are welcome to redistribute it under certain   
 conditions; see the file COPYING for details, or gnu.org/licenses/gpl-2.0.txt  
""" )
开发者ID:andybalaam,项目名称:diffident,代码行数:26,代码来源:test_ncursesview_helpscreen.py

示例6: _right

def _right(key):
    view = _make_view()
    actions = [key]
    assert_strings_equal(
        view.show(actions)[0],
        """[n]line 1 here          [ni]line 1 here        
[n]line 2 here          line 2 here        
""",
    )
开发者ID:andybalaam,项目名称:diffident,代码行数:9,代码来源:test_ncursesview_movement.py

示例7: right_twice

def right_twice():
    view = _make_view()
    actions = [curses.KEY_RIGHT, curses.KEY_RIGHT]
    assert_strings_equal(
        view.show(actions)[0],
        """[n]line 1 here          [ni]line 1 here        
[n]line 2 here          line 2 here        
""",
    )
开发者ID:andybalaam,项目名称:diffident,代码行数:9,代码来源:test_ncursesview_movement.py

示例8: down_scroll

def down_scroll():
    view = _make_view()

    actions = [curses.KEY_DOWN, curses.KEY_DOWN]

    assert_strings_equal(
        view.show(actions)[0],
        """[n]line 2 here          line 2 here        
[ni]line 3 here       [n]   line 3 here        
""",
    )
开发者ID:andybalaam,项目名称:diffident,代码行数:11,代码来源:test_ncursesview_movement.py

示例9: _page_up

def _page_up(key):
    view = _make_view()

    actions = [curses.KEY_NPAGE, key]

    assert_strings_equal(
        view.show(actions)[0],
        """[ni]line 1 here       [n]   line 1 here        
line 2 here          line 2 here        
""",
    )
开发者ID:andybalaam,项目名称:diffident,代码行数:11,代码来源:test_ncursesview_movement.py

示例10: _page_down

def _page_down(key):
    view = _make_view()

    actions = [key]

    assert_strings_equal(
        view.show(actions)[0],
        """[ni]line 3 here       [n]   line 3 here        
line 4 here          line 4 here        
""",
    )
开发者ID:andybalaam,项目名称:diffident,代码行数:11,代码来源:test_ncursesview_movement.py

示例11: page_right_page_down

def page_right_page_down():
    view = _make_wide_view()

    # Right, Down, PageRight, PageDown
    actions = [curses.KEY_RIGHT, curses.KEY_DOWN, "x", curses.KEY_NPAGE]

    assert_strings_equal(
        view.show(actions)[0],
        """[m]..........[ai] + [a]56789abcde
[r]56789abcde[ri] - [mi]..........
""",
    )
开发者ID:andybalaam,项目名称:diffident,代码行数:12,代码来源:test_ncursesview_movement.py

示例12: page_left_stop_at_beginning

def page_left_stop_at_beginning():
    view = _make_wide_view()

    # PageRight, PageLeft 3 times
    actions = ["x", "z", "z", "z"]

    assert_strings_equal(
        view.show(actions)[0],
        """[ni]0-23456789[n]   0-23456789
[d]1-23456789[di] * [d]1-23456789
""",
    )
开发者ID:andybalaam,项目名称:diffident,代码行数:12,代码来源:test_ncursesview_movement.py

示例13: page_up_short_diff

def page_up_short_diff():
    view = _make_short_diff_view()
    actions = [curses.KEY_PPAGE]

    assert_strings_equal(
        view.show(actions)[0],
        """[ni]line 01 [n]   line 01  
line 02    line 02  
                    
                    
""",
    )
开发者ID:andybalaam,项目名称:diffident,代码行数:12,代码来源:test_ncursesview_movement.py

示例14: page_right_thrice

def page_right_thrice():
    view = _make_wide_view()

    # PageRight 3 times
    actions = ["x", "x", "x"]

    assert_strings_equal(
        view.show(actions)[0],
        """[ni]f         [n]   f         
[d]f         [di] * [d]f plus ext
""",
    )
开发者ID:andybalaam,项目名称:diffident,代码行数:12,代码来源:test_ncursesview_movement.py

示例15: page_right

def page_right():
    view = _make_wide_view()

    # PageRight
    actions = ["x"]

    assert_strings_equal(
        view.show(actions)[0],
        """[ni]56789abcde[n]   56789abcde
[d]56789abcde[di] * [d]56789abcde
""",
    )
开发者ID:andybalaam,项目名称:diffident,代码行数:12,代码来源:test_ncursesview_movement.py


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