File tree Expand file tree Collapse file tree 1 file changed +0
-36
lines changed Expand file tree Collapse file tree 1 file changed +0
-36
lines changed Original file line number Diff line number Diff line change 11package sqs
22
33import (
4- "fmt"
54 "testing"
65
76 "github.com/aws/aws-sdk-go/aws"
8- "github.com/goadapp/goad/api"
97 "github.com/stretchr/testify/assert"
108)
119
12- func init () {
13- }
14-
1510func TestAdapterConstruction (t * testing.T ) {
1611 config := aws .NewConfig ().WithRegion ("somewhere" )
1712 testsqs := NewSQSAdapter (config , "testqueue" )
1813 assert .Equal (t , testsqs .QueueURL , "testqueue" )
1914}
20-
21- func TestJSON (t * testing.T ) {
22- assert := assert .New (t )
23- // This test just verifies the json api.
24- result := api.RunnerResult {
25- RequestCount : 299 ,
26- TimedOut : 234 ,
27- ConnectionErrors : 256 ,
28- AveTimeToFirst : 9999 ,
29- BytesRead : 2136 ,
30- // Statuses: new(map[string]int),
31- AveTimeForReq : 12345 ,
32- // AveReqPerSec: 6789,
33- // AveKBytesPerSec: 6789,
34- Slowest : 4567 ,
35- Fastest : 4567 ,
36- Region : "eu-west" ,
37- RunnerID : 0 ,
38- FatalError : "sorry" ,
39- }
40- str , jsonerr := jsonFromResult (result )
41- if jsonerr != nil {
42- fmt .Println (jsonerr )
43- return
44- }
45- json , err := resultFromJSON (str )
46- if err != nil {
47- t .Fatal (err )
48- }
49- assert .EqualValues (result , json , "Should serialize and deserialize without error and loosing information" )
50- }
You can’t perform that action at this time.
0 commit comments