Skip to content

Commit

Permalink
Fix tracker test.
Browse files Browse the repository at this point in the history
Signed-off-by: Jeff Ortel <[email protected]>
  • Loading branch information
jortel committed Sep 5, 2024
1 parent a125afa commit f72ce66
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
8 changes: 8 additions & 0 deletions test/api/tracker/api_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,10 @@ func TestTrackerCRUD(t *testing.T) {
assert.Must(t, Identity.Delete(identity.ID))

// Check if the Tracker is present even after deletion or not.
_, err = Identity.Get(r.Identity.ID)
if err == nil {
t.Errorf("Resource exits, but should be deleted: %v", r)
}
_, err = Tracker.Get(r.ID)
if err == nil {
t.Errorf("Resource exits, but should be deleted: %v", r)
Expand Down Expand Up @@ -114,6 +118,10 @@ func TestTrackerCRUD(t *testing.T) {
assert.Must(t, Identity.Delete(identity.ID))

// Check if the Tracker is present even after deletion or not.
_, err = Identity.Get(r.Identity.ID)
if err == nil {
t.Errorf("Resource exits, but should be deleted: %v", r)
}
_, err = Tracker.Get(r.ID)
if err == nil {
t.Errorf("Resource exits, but should be deleted: %v", r)
Expand Down
2 changes: 0 additions & 2 deletions test/api/tracker/samples.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ var Samples = []api.Tracker{
Message: "Description of tracker",
LastUpdated: time.Date(time.Now().Year(), time.Now().Month(), time.Now().Day(), 0, 0, 0, 0, time.Local),
Identity: api.Ref{
ID: 1,
Name: "Sample Tracker Identity",
},
Insecure: false,
Expand All @@ -26,7 +25,6 @@ var Samples = []api.Tracker{
Message: "Description of tracker1",
LastUpdated: time.Date(time.Now().Year(), time.Now().Month(), time.Now().Day(), 0, 0, 0, 0, time.Local),
Identity: api.Ref{
ID: 2,
Name: "Sample Tracker Identity1",
},
Insecure: false,
Expand Down

0 comments on commit f72ce66

Please sign in to comment.