コード例 #1
0
ファイル: test_konch.py プロジェクト: OdinsHat/konch
def test_make_banner_with_context():
    context = {'foo': 42}
    result = konch.make_banner(context=context)
    assert konch.format_context(context) in result
コード例 #2
0
ファイル: test_konch.py プロジェクト: OdinsHat/konch
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
コード例 #3
0
ファイル: test_konch.py プロジェクト: zlksnk/konch
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
コード例 #4
0
ファイル: test_konch.py プロジェクト: OdinsHat/konch
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
コード例 #5
0
ファイル: test_konch.py プロジェクト: smeggingsmegger/konch
def test_default_make_banner():
    result = konch.make_banner()
    assert sys.version in result
    assert konch.DEFAULT_BANNER_TEXT in result
コード例 #6
0
ファイル: test_konch.py プロジェクト: zlksnk/konch
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
コード例 #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
コード例 #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
コード例 #9
0
ファイル: test_konch.py プロジェクト: sloria/konch
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
コード例 #10
0
ファイル: test_konch.py プロジェクト: sloria/konch
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
コード例 #11
0
ファイル: test_konch.py プロジェクト: sloria/konch
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