Skip to content

Commit

Permalink
Fix testing
Browse files Browse the repository at this point in the history
  • Loading branch information
hwchiu committed Jul 7, 2018
1 parent 715758f commit 5545155
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion src/server/handler_volume_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,7 @@ func (suite *VolumeTestSuite) TestCreateVolume() {
}

func (suite *VolumeTestSuite) TestCreateVolumeWithInvalidParameter() {
//the storageName doesn't exist
tName := namesgenerator.GetRandomName(0)
tAccessMode := corev1.PersistentVolumeAccessMode("ReadOnlyMany")
tCapacity := "500G"
Expand All @@ -132,7 +133,7 @@ func (suite *VolumeTestSuite) TestCreateVolumeWithInvalidParameter() {
httpRequest.Header.Add("Content-Type", "application/json")
httpWriter := httptest.NewRecorder()
suite.wc.Dispatch(httpWriter, httpRequest)
assertResponseCode(suite.T(), http.StatusBadRequest, httpWriter)
assertResponseCode(suite.T(), http.StatusInternalServerError, httpWriter)
defer suite.session.Remove(entity.VolumeCollectionName, "name", volume.Name)
}

Expand Down
2 changes: 1 addition & 1 deletion src/volume/volume.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import (
)

func getPVCInstance(volume *entity.Volume, storageClassName string) *v1.PersistentVolumeClaim {
capacity, _ := resource.ParseQuantity(volume.Capacity + "Gi")
capacity, _ := resource.ParseQuantity(volume.Capacity)
return &v1.PersistentVolumeClaim{
ObjectMeta: metav1.ObjectMeta{
Name: volume.MetaName,
Expand Down

0 comments on commit 5545155

Please sign in to comment.