Example #1
0
def test_make_banner_with_context():
    context = {'foo': 42}
    result = konch.make_banner(context=context)
    assert konch.format_context(context) in result
Example #2
0
def test_make_banner_hide_context():
    context = {'foo': 42}
    result = konch.make_banner(context=context, hide_context=True)
    assert konch.format_context(context) not in result
Example #3
0
def test_make_banner_includes_full_context_by_default():
    context = {"foo": 42}
    result = konch.make_banner(context=context)
    assert konch.format_context(context, formatter="full") in result
Example #4
0
def test_make_banner_custom():
    text = 'I want to be the very best'
    result = konch.make_banner(text)
    assert text in result
    assert sys.version in result
Example #5
0
def test_default_make_banner():
    result = konch.make_banner()
    assert sys.version in result
    assert konch.DEFAULT_BANNER_TEXT in result
Example #6
0
def test_make_banner_custom():
    text = "I want to be the very best"
    result = konch.make_banner(text)
    assert text in result
    assert sys.version in result
Example #7
0
def test_make_banner_custom_format():
    context = {"foo": 42}
    result = konch.make_banner(context=context,
                               context_format=lambda ctx: repr(ctx))
    assert repr(context) in result
Example #8
0
def test_make_banner_hide_context():
    context = {"foo": 42}
    result = konch.make_banner(context=context, context_format="hide")
    assert konch.format_context(context) not in result
Example #9
0
def test_make_banner_custom_format():
    context = {"foo": 42}
    result = konch.make_banner(context=context, context_format=lambda ctx: repr(ctx))
    assert repr(context) in result
Example #10
0
def test_make_banner_hide_context():
    context = {"foo": 42}
    result = konch.make_banner(context=context, context_format="hide")
    assert konch.format_context(context) not in result
Example #11
0
def test_make_banner_includes_full_context_by_default():
    context = {"foo": 42}
    result = konch.make_banner(context=context)
    assert konch.format_context(context, formatter="full") in result