-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #459 from subutai-io/404
added fix for #404
- Loading branch information
Showing
8 changed files
with
263 additions
and
205 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
package config | ||
|
||
import ( | ||
"testing" | ||
"strconv" | ||
) | ||
|
||
func TestDefaultQuota(t *testing.T) { | ||
tests := []struct { | ||
name string | ||
want int | ||
}{ | ||
{name: "TestDefaultQuota-"}, | ||
// TODO: Add test cases. | ||
} | ||
for i := 1; i <= 2; i++ { | ||
test := tests[0] | ||
test.name += strconv.Itoa(i) | ||
tests = append(tests, test) | ||
} | ||
tests[0].name += "0" | ||
wants := []int{1 << 31, 1 << 21, 1 << 11} | ||
for i := 0; i <= 2; i++ { | ||
tests[i].want = wants[i] | ||
} | ||
quotas := []string{"2G", "2M", "2K"} | ||
for i, tt := range tests { | ||
t.Run(tt.name, func(t *testing.T) { | ||
config.Storage.Userquota = quotas[i] | ||
if got := DefaultQuota(); got != tt.want { | ||
t.Errorf("DefaultQuota() = %v, want %v", got, tt.want) | ||
} | ||
}) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.