Skip to content

Commit

Permalink
[YUNIKORN-2859] Add missing assertion in TestGetApplicationHandler (#965
Browse files Browse the repository at this point in the history
)

Closes: #965

Signed-off-by: Craig Condit <[email protected]>
  • Loading branch information
ryankert01 authored and craigcondit committed Sep 10, 2024
1 parent 3a712d4 commit 9e10746
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions pkg/webservice/handlers_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1741,12 +1741,10 @@ func TestGetApplicationHandler(t *testing.T) {
getApplication(resp, req)
err = json.Unmarshal(resp.outputBytes, &appsDao)
assert.NilError(t, err, unmarshalError)

if !appsDao.HasReserved {
assert.Equal(t, len(appsDao.Reservations), 0)
} else {
assert.Check(t, len(appsDao.Reservations) > 0, "app should have at least 1 reservation")
}
assert.Equal(t, appsDao.ApplicationID, "app-1")
assert.Equal(t, appsDao.Partition, "default")
assert.Equal(t, appsDao.QueueName, "root.default")
assert.Equal(t, len(appsDao.Allocations), 0)

// test nonexistent partition
var req1 *http.Request
Expand Down Expand Up @@ -1781,6 +1779,11 @@ func TestGetApplicationHandler(t *testing.T) {
getApplication(resp4, req4)
err = json.Unmarshal(resp4.outputBytes, &appsDao4)
assert.NilError(t, err, unmarshalError)
assert.Assert(t, appsDao4 != nil)
assert.Equal(t, appsDao4.ApplicationID, "app-1")
assert.Equal(t, appsDao4.Partition, "default")
assert.Equal(t, appsDao4.QueueName, "root.default")
assert.Equal(t, len(appsDao4.Reservations), 0)

// test invalid queue name
var req5 *http.Request
Expand Down

0 comments on commit 9e10746

Please sign in to comment.