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]
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]
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]
def test_default_arguments(pl, segment_info, expected_symbol): output = pk.context(pl=pl, segment_info=segment_info) assert output == [expected_symbol, EXPECTED_NAMESPACE]
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 == []
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]
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 == []