-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
0d4d70e
commit 10675ee
Showing
2 changed files
with
31 additions
and
2 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,29 @@ | ||
package main | ||
import ( | ||
"testing" | ||
"time" | ||
) | ||
|
||
var testPlan = Golts{ | ||
Golt: []GoltThreadGroup{ | ||
GoltThreadGroup{Stage: 1, Timeout: 100}, | ||
GoltThreadGroup{Stage: 3, Timeout: 300}, | ||
GoltThreadGroup{Stage: 2, Timeout: 400}, | ||
GoltThreadGroup{Stage: 1, Timeout: 200}, | ||
}, | ||
} | ||
func TestGenerateStageMap(t *testing.T) { | ||
m := generateStageMap(testPlan) | ||
if len(m[1]) != 2 || len(m[2]) != 1 || len(m[3]) != 1 { | ||
t.Error("The stage map was not generated properly") | ||
} | ||
} | ||
|
||
func TestGenerateHttpClient(t *testing.T) { | ||
for _, entry := range testPlan.Golt { | ||
client := generateHttpClient(entry) | ||
if client.Timeout != time.Duration(time.Millisecond * time.Duration(entry.Timeout)) { | ||
t.Error("The http client was not generated properly") | ||
} | ||
} | ||
} |