Skip to content

Commit

Permalink
test: remove now-obsolete duplicate test
Browse files Browse the repository at this point in the history
Signed-off-by: Zachary Newman <[email protected]>
  • Loading branch information
znewman01 committed Aug 5, 2022
1 parent 6989f35 commit 0bddfe4
Showing 1 changed file with 0 additions and 19 deletions.
19 changes: 0 additions & 19 deletions client/client_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -244,25 +244,6 @@ func (s *ClientSuite) assertErrExpired(c *C, err error, file string) {
c.Assert(expiredErr.Expired.Unix(), Equals, s.expiredTime.Round(time.Second).Unix())
}

func (s *ClientSuite) TestInit(c *C) {
client := NewClient(MemoryLocalStore(), s.remote)

// check invalid json
c.Assert(client.Init(make([]byte, 0)), NotNil)
rootJson := `{ "signatures": [], "signed": {"version": "wrongtype"}, "spec_version": "1.0.0", "version": 1}`
err := client.Init([]byte(rootJson))
c.Assert(err.Error(), Matches, "json: cannot unmarshal string.*")

// check Update() returns ErrNoRootKeys when uninitialized
_, err = client.Update()
c.Assert(err, Equals, ErrNoRootKeys)

// check Update() does not return ErrNoRootKeys after initialization
c.Assert(client.Init(s.rootMeta(c)), IsNil)
_, err = client.Update()
c.Assert(err, IsNil)
}

func (s *ClientSuite) TestInitAllowsExpired(c *C) {
s.genKeyExpired(c, "targets")
c.Assert(s.repo.Snapshot(), IsNil)
Expand Down

0 comments on commit 0bddfe4

Please sign in to comment.