예제 #1
0
def test_console_options_update():
    options = ConsoleOptions(min_width=10,
                             max_width=20,
                             is_terminal=False,
                             encoding="utf-8")
    options1 = options.update(width=15)
    assert options1.min_width == 15 and options1.max_width == 15

    options2 = options.update(min_width=5, max_width=15, justify="right")
    assert (options2.min_width == 5 and options2.max_width == 15
            and options2.justify == "right")

    options_copy = options.update()
    assert options_copy == options and options_copy is not options
예제 #2
0
def test_console_options_update():
    options = ConsoleOptions(
        ConsoleDimensions(80, 25),
        max_height=25,
        legacy_windows=False,
        min_width=10,
        max_width=20,
        is_terminal=False,
        encoding="utf-8",
    )
    options1 = options.update(width=15)
    assert options1.min_width == 15 and options1.max_width == 15

    options2 = options.update(min_width=5, max_width=15, justify="right")
    assert (options2.min_width == 5 and options2.max_width == 15
            and options2.justify == "right")

    options_copy = options.update()
    assert options_copy == options and options_copy is not options