1 // Copyright (C) The Arvados Authors. All rights reserved.
3 // SPDX-License-Identifier: AGPL-3.0
10 "git.arvados.org/arvados.git/sdk/go/arvados"
12 check "gopkg.in/check.v1"
15 var _ = check.Suite(&changeSetSuite{})
17 type changeSetSuite struct{}
19 func (s *changeSetSuite) TestJSONFormat(c *check.C) {
21 KeepMount: arvados.KeepMount{
22 UUID: "zzzzz-mount-abcdefghijklmno"}}
24 KeepService: arvados.KeepService{
25 UUID: "zzzzz-bi6l4-000000000000001",
27 ServiceSSLFlag: false,
28 ServiceHost: "keep1.zzzzz.arvadosapi.com",
31 buf, err := json.Marshal([]Pull{{
32 SizedDigest: arvados.SizedDigest("acbd18db4cc2f85cedef654fccc4a4d8+3"),
35 c.Check(err, check.IsNil)
36 c.Check(string(buf), check.Equals, `[{"locator":"acbd18db4cc2f85cedef654fccc4a4d8+3","servers":["http://keep1.zzzzz.arvadosapi.com:25107"],"mount_uuid":"zzzzz-mount-abcdefghijklmno"}]`)
38 buf, err = json.Marshal([]Trash{{
39 SizedDigest: arvados.SizedDigest("acbd18db4cc2f85cedef654fccc4a4d8+3"),
42 c.Check(err, check.IsNil)
43 c.Check(string(buf), check.Equals, `[{"locator":"acbd18db4cc2f85cedef654fccc4a4d8+3","block_mtime":123456789,"mount_uuid":"zzzzz-mount-abcdefghijklmno"}]`)