File tree Expand file tree Collapse file tree 1 file changed +21
-8
lines changed
simulators/ethereum/graphql Expand file tree Collapse file tree 1 file changed +21
-8
lines changed Original file line number Diff line number Diff line change @@ -22,15 +22,28 @@ type gasPrice struct {
2222func Test_responseMatch (t * testing.T ) {
2323 // create hivesim tester
2424 hivesimT := & hivesim.T {}
25- // unmarshal JSON test file
26- fp := "./testcases/07_eth_gasPrice.json"
27- data , err := os .ReadFile (fp )
28- if err != nil {
29- t .Fatalf ("Warning: can't read test file %s: %v" , fp , err )
30- }
25+ data := `
26+ {
27+ "request":
28+ "{ gasPrice }",
29+ "responses": [
30+ {
31+ "data" : {
32+ "gasPrice" : "0x10"
33+ }
34+ },
35+ {
36+ "data" : {
37+ "gasPrice" : "0x1"
38+ }
39+ }
40+ ],
41+ "statusCode": 200
42+ }
43+ `
3144 var gqlTest graphQLTest
32- if err = json .Unmarshal (data , & gqlTest ); err != nil {
33- t .Fatalf ("Warning: can't unmarshal test file %s: %v" , fp , err )
45+ if err : = json .Unmarshal ([] byte ( data ) , & gqlTest ); err != nil {
46+ t .Fatalf ("Warning: can't unmarshal test %v" , err )
3447 }
3548 // build test case
3649 tc := testCase {
You can’t perform that action at this time.
0 commit comments