Ejemplo n.º 1
0
def test_cluster_user(pl, segment_info, expected_symbol):
    output = pk.context(pl=pl, segment_info=segment_info,
                        show_cluster=True, show_namespace=False, show_user=True)
    assert output == [expected_symbol, EXPECTED_CLUSTER, EXPECTED_USER]
Ejemplo n.º 2
0
def test_only_namespace(pl, segment_info, expected_symbol):
    output = pk.context(pl=pl, segment_info=segment_info,
                        show_cluster=False, show_namespace=True, show_user=False)
    assert output == [expected_symbol, EXPECTED_NAMESPACE]
Ejemplo n.º 3
0
def test_all_items(pl, segment_info, expected_symbol):
    output = pk.context(pl=pl, segment_info=segment_info,
                        show_cluster=True, show_namespace=True, show_user=True)
    assert output == [expected_symbol, EXPECTED_CLUSTER, EXPECTED_NAMESPACE, EXPECTED_USER]
Ejemplo n.º 4
0
def test_default_arguments(pl, segment_info, expected_symbol):
    output = pk.context(pl=pl, segment_info=segment_info)
    assert output == [expected_symbol, EXPECTED_NAMESPACE]
Ejemplo n.º 5
0
def test_does_not_show_if_env_var_is_not_yes(pl, envvar):
    segment_info = {'environ': {'RENDER_POWERLINE_KUBERNETES': envvar}}
    output = pk.context(pl=pl, segment_info=segment_info)
    assert output == []
Ejemplo n.º 6
0
def test_shows_if_env_var_is_yes(pl, expected_symbol):
    segment_info = {'environ': {'RENDER_POWERLINE_KUBERNETES': 'YES'}}
    output = pk.context(pl=pl, segment_info=segment_info)
    assert output == [expected_symbol, EXPECTED_NAMESPACE]
Ejemplo n.º 7
0
def test_no_items(pl, segment_info):
    output = pk.context(pl=pl, segment_info=segment_info,
                        show_cluster=False, show_namespace=False, show_user=False)
    assert output == []