def test_make_banner_with_context(): context = {'foo': 42} result = konch.make_banner(context=context) assert konch.format_context(context) in result
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
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
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
def test_default_make_banner(): result = konch.make_banner() assert sys.version in result assert konch.DEFAULT_BANNER_TEXT in result
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
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
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