X-Git-Url: https://git.arvados.org/arvados.git/blobdiff_plain/96370576f11dd97429dd5a2424de7a5cafaa84ca..ab8458af1a3f3a82487e10384c2fd61906db7c85:/sdk/go/arvados/fs_project_test.go diff --git a/sdk/go/arvados/fs_project_test.go b/sdk/go/arvados/fs_project_test.go index 56a2bb8264..0564e2fae6 100644 --- a/sdk/go/arvados/fs_project_test.go +++ b/sdk/go/arvados/fs_project_test.go @@ -39,10 +39,9 @@ func (sc *spyingClient) RequestAndDecode(dst interface{}, method, path string, b return sc.Client.RequestAndDecode(dst, method, path, body, params) } -// TestFilterGroup is a very basic filter group test. It makes sure that a -// collection and group that match the filter are present, and that a group -// that does not match the filter is not present. func (s *SiteFSSuite) TestFilterGroup(c *check.C) { + // Make sure that a collection and group that match the filter are present, + // and that a group that does not match the filter is not present. s.fs.MountProject("fg", fixtureThisFilterGroupUUID) _, err := s.fs.OpenFile("/fg/baz_file", 0, 0) @@ -53,6 +52,27 @@ func (s *SiteFSSuite) TestFilterGroup(c *check.C) { _, err = s.fs.OpenFile("/fg/A Project", 0, 0) c.Assert(err, check.Not(check.IsNil)) + + // An empty filter means everything that is visible should be returned. + s.fs.MountProject("fg2", fixtureAFilterGroupTwoUUID) + + _, err = s.fs.OpenFile("/fg2/baz_file", 0, 0) + c.Assert(err, check.IsNil) + + _, err = s.fs.OpenFile("/fg2/A Subproject", 0, 0) + c.Assert(err, check.IsNil) + + _, err = s.fs.OpenFile("/fg2/A Project", 0, 0) + c.Assert(err, check.IsNil) + + // An 'is_a' 'arvados#collection' filter means only collections should be returned. + s.fs.MountProject("fg3", fixtureAFilterGroupThreeUUID) + + _, err = s.fs.OpenFile("/fg3/baz_file", 0, 0) + c.Assert(err, check.IsNil) + + _, err = s.fs.OpenFile("/fg3/A Subproject", 0, 0) + c.Assert(err, check.Not(check.IsNil)) } func (s *SiteFSSuite) TestCurrentUserHome(c *check.C) {