1 // Copyright (C) The Arvados Authors. All rights reserved.
3 // SPDX-License-Identifier: AGPL-3.0
10 "git.curoverse.com/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 KeepService: arvados.KeepService{
22 UUID: "zzzzz-bi6l4-000000000000001",
24 ServiceSSLFlag: false,
25 ServiceHost: "keep1.zzzzz.arvadosapi.com",
28 buf, err := json.Marshal([]Pull{{
29 SizedDigest: arvados.SizedDigest("acbd18db4cc2f85cedef654fccc4a4d8+3"),
31 c.Check(err, check.IsNil)
32 c.Check(string(buf), check.Equals, `[{"locator":"acbd18db4cc2f85cedef654fccc4a4d8","servers":["http://keep1.zzzzz.arvadosapi.com:25107"]}]`)
34 buf, err = json.Marshal([]Trash{{
35 SizedDigest: arvados.SizedDigest("acbd18db4cc2f85cedef654fccc4a4d8+3"),
37 c.Check(err, check.IsNil)
38 c.Check(string(buf), check.Equals, `[{"locator":"acbd18db4cc2f85cedef654fccc4a4d8","block_mtime":123456789}]`)