Skip to content

Commit

Permalink
Merge pull request theupdateframework#3 from DataDog/raphael/version_…
Browse files Browse the repository at this point in the history
…helpers

Add version helpers
  • Loading branch information
raphaelgavache authored Jul 19, 2021
2 parents 6df2a97 + d802c08 commit f621e85
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
8 changes: 8 additions & 0 deletions client/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -737,3 +737,11 @@ func (c *Client) Targets() (data.TargetFiles, error) {
}
return c.targets, nil
}

func (c *Client) RootVersion() int {
return c.rootVer
}

func (c *Client) TargetsVersion() int {
return c.targetsVer
}
3 changes: 3 additions & 0 deletions client/delegations_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -197,6 +197,9 @@ func TestGetTargetMeta(t *testing.T) {
f, err := c.getTargetFileMeta("f.txt")
assert.Nil(t, err)
assert.Equal(t, int64(15), f.Length)

assert.Equal(t, c.RootVersion(), 2)
assert.Equal(t, c.TargetsVersion(), 2)
}

func TestMaxDelegations(t *testing.T) {
Expand Down

0 comments on commit f621e85

Please sign in to comment.