Skip to content

Commit b343ab9

Browse files
committed
tests: Adjustments made after modifying getServerSupportedFilters
Signed-off-by: Piotr Resztak <[email protected]>
1 parent 17022dd commit b343ab9

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

cmd/incus/list_test.go

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -115,10 +115,6 @@ func TestShouldShow(t *testing.T) {
115115
t.Error("user.blah=abc type=container didn't match")
116116
}
117117

118-
if list.shouldShow([]string{"bar", "u.blah=abc"}, inst, nil, false) {
119-
t.Errorf("name filter didn't work")
120-
}
121-
122118
if list.shouldShow([]string{"bar", "u.blah=other"}, inst, nil, false) {
123119
t.Errorf("value filter didn't work")
124120
}

cmd/incus/utils_test.go

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,11 @@ func (s *utilsTestSuite) TestGetServerSupportedFilters() {
7878
"foo", "type=container", "user.blah=a", "status=running,stopped",
7979
}
8080

81-
supportedFilters, unsupportedFilters := getServerSupportedFilters(filters, api.InstanceFull{})
81+
supportedFilters, unsupportedFilters := getServerSupportedFilters(filters, api.InstanceFull{}, false)
8282
s.Equal([]string{"type=container"}, supportedFilters)
8383
s.Equal([]string{"foo", "user.blah=a", "status=running,stopped"}, unsupportedFilters)
84+
85+
supportedFilters, unsupportedFilters = getServerSupportedFilters(filters, api.InstanceFull{}, true)
86+
s.Equal([]string{"foo", "type=container"}, supportedFilters)
87+
s.Equal([]string{"user.blah=a", "status=running,stopped"}, unsupportedFilters)
8488
}

0 commit comments

Comments
 (0)