File tree 1 file changed +21
-8
lines changed
simulators/ethereum/graphql
1 file changed +21
-8
lines changed Original file line number Diff line number Diff line change @@ -22,15 +22,28 @@ type gasPrice struct {
22
22
func Test_responseMatch (t * testing.T ) {
23
23
// create hivesim tester
24
24
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
+ `
31
44
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 )
34
47
}
35
48
// build test case
36
49
tc := testCase {
You can’t perform that action at this time.
0 commit comments