mirror of
https://github.com/optim-enterprises-bv/kubernetes.git
synced 2025-12-07 16:45:35 +00:00
Revert "Extend all to more resources"
This commit is contained in:
@@ -1154,6 +1154,39 @@ func TestReceiveMultipleErrors(t *testing.T) {
|
||||
}
|
||||
}
|
||||
|
||||
func TestReplaceAliases(t *testing.T) {
|
||||
tests := []struct {
|
||||
name string
|
||||
arg string
|
||||
expected string
|
||||
}{
|
||||
{
|
||||
name: "no-replacement",
|
||||
arg: "service",
|
||||
expected: "service",
|
||||
},
|
||||
{
|
||||
name: "all-replacement",
|
||||
arg: "all",
|
||||
expected: "rc,svc,pods,pvc",
|
||||
},
|
||||
{
|
||||
name: "alias-in-comma-separated-arg",
|
||||
arg: "all,secrets",
|
||||
expected: "rc,svc,pods,pvc,secrets",
|
||||
},
|
||||
}
|
||||
|
||||
b := NewBuilder(testapi.Default.RESTMapper(), api.Scheme, fakeClient(), testapi.Default.Codec())
|
||||
|
||||
for _, test := range tests {
|
||||
replaced := b.replaceAliases(test.arg)
|
||||
if replaced != test.expected {
|
||||
t.Errorf("%s: unexpected argument: expected %s, got %s", test.name, test.expected, replaced)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
func TestHasNames(t *testing.T) {
|
||||
tests := []struct {
|
||||
args []string
|
||||
|
||||
Reference in New Issue
Block a user