Skip to content

Commit

Permalink
Archive Policies: add acc test for Update method
Browse files Browse the repository at this point in the history
Add Update call into the archive policies acceptance test.
  • Loading branch information
ozerovandrei committed Jun 10, 2018
1 parent 558e4c0 commit f556794
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions acceptance/gnocchi/metric/v1/archivepolicies_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,26 @@ func TestArchivePoliciesCRUD(t *testing.T) {
// defer DeleteArchivePolicy(t, client, archivePolicy.ID)

tools.PrintResource(t, archivePolicy)

updateOpts := archivepolicies.UpdateOpts{
Definition: []archivepolicies.ArchivePolicyDefinitionOpts{
{
Granularity: "1:00:00",
TimeSpan: "90 days, 0:00:00",
},
{
Granularity: "24:00:00",
TimeSpan: "365 days, 0:00:00",
},
},
}
t.Logf("Attempting to update an archive policy %s", archivePolicy.Name)
newArchivePolicy, err := archivepolicies.Update(client, archivePolicy.Name, updateOpts).Extract()
if err != nil {
t.Fatalf("Unable to update a Gnocchi archive policy: %v", err)
}

tools.PrintResource(t, newArchivePolicy)
}

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

0 comments on commit f556794

Please sign in to comment.