Skip to content

Commit

Permalink
Remove superfluous use of gock:
Browse files Browse the repository at this point in the history
Eventually, gock will be removed entirely.
  • Loading branch information
dimroc committed Mar 23, 2018
1 parent b44d015 commit ced632f
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 42 deletions.
2 changes: 0 additions & 2 deletions internal/fixtures/web/uint256_job.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
{
"initiators": [{ "type": "web" }],
"tasks": [
{ "type": "HttpGet", "url": "https://bitstamp.net/api/ticker/" },
{ "type": "JsonParse", "path": ["last"] },
{ "type": "Multiply", "times": 100 },
{ "type": "EthUint256" }
]
Expand Down
9 changes: 0 additions & 9 deletions internal/fixtures/web/uint256_string_times_job.json

This file was deleted.

32 changes: 1 addition & 31 deletions web/integration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -329,42 +329,12 @@ func TestIntegration_WeiWatchers(t *testing.T) {
}

func TestIntegration_MultiplierUint256(t *testing.T) {
gock.EnableNetworking()
defer cltest.CloseGock(t)

app, cleanup := cltest.NewApplication()
defer cleanup()
app.Start()

gock.New("https://bitstamp.net").
Get("/api/ticker").
Reply(200).
JSON(`{"last": "10221.30"}`)

j := cltest.FixtureCreateJobViaWeb(t, app, "../internal/fixtures/web/uint256_job.json")
jr := cltest.CreateJobRunViaWeb(t, app, j)
jr = cltest.WaitForJobRunToComplete(t, app.Store, jr)

val, err := jr.Result.Value()
assert.Nil(t, err)
assert.Equal(t, "0x00000000000000000000000000000000000000000000000000000000000f98b2", val)
}

func TestIntegration_MultiplierUint256String(t *testing.T) {
gock.EnableNetworking()
defer cltest.CloseGock(t)

app, cleanup := cltest.NewApplication()
defer cleanup()
app.Start()

gock.New("https://bitstamp.net").
Get("/api/ticker").
Reply(200).
JSON(`{"last": "10221.30"}`)

j := cltest.FixtureCreateJobViaWeb(t, app, "../internal/fixtures/web/uint256_string_times_job.json")
jr := cltest.CreateJobRunViaWeb(t, app, j)
jr := cltest.CreateJobRunViaWeb(t, app, j, `{"value":"10221.30"}`)
jr = cltest.WaitForJobRunToComplete(t, app.Store, jr)

val, err := jr.Result.Value()
Expand Down

0 comments on commit ced632f

Please sign in to comment.