Skip to content

Commit

Permalink
refactor: use schema IDorName
Browse files Browse the repository at this point in the history
  • Loading branch information
jooola committed Nov 5, 2024
1 parent 04d2b79 commit 036eef1
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions builder/hcloud/step_create_server_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ func TestStepCreateServer(t *testing.T) {
Want: func(t *testing.T, req *http.Request) {
payload := decodeJSONBody(t, req.Body, &schema.ServerCreateRequest{})
assert.Equal(t, "dummy-server", payload.Name)
assert.Equal(t, int64(114690387), int64(payload.Image.(float64)))
assert.Equal(t, int64(114690387), payload.Image.ID)
assert.Equal(t, "nbg1", payload.Location)
assert.Equal(t, "cpx11", payload.ServerType)
assert.True(t, payload.PublicNet.EnableIPv4)
Expand Down Expand Up @@ -119,7 +119,7 @@ func TestStepCreateServer(t *testing.T) {
Want: func(t *testing.T, req *http.Request) {
payload := decodeJSONBody(t, req.Body, &schema.ServerCreateRequest{})
assert.Equal(t, "dummy-server", payload.Name)
assert.Equal(t, int64(114690387), int64(payload.Image.(float64)))
assert.Equal(t, int64(114690387), payload.Image.ID)
assert.Equal(t, "nbg1", payload.Location)
assert.Equal(t, "cpx11", payload.ServerType)
assert.Equal(t, int64(986532), payload.Firewalls[0].Firewall)
Expand Down Expand Up @@ -189,7 +189,7 @@ func TestStepCreateServer(t *testing.T) {
Want: func(t *testing.T, req *http.Request) {
payload := decodeJSONBody(t, req.Body, &schema.ServerCreateRequest{})
assert.Equal(t, "dummy-server", payload.Name)
assert.Equal(t, int64(114690387), int64(payload.Image.(float64)))
assert.Equal(t, int64(114690387), payload.Image.ID)
assert.Equal(t, "nbg1", payload.Location)
assert.Equal(t, "cpx11", payload.ServerType)
assert.Equal(t, []int64{12}, payload.Networks)
Expand Down Expand Up @@ -287,7 +287,7 @@ func TestStepCreateServer(t *testing.T) {
Want: func(t *testing.T, req *http.Request) {
payload := decodeJSONBody(t, req.Body, &schema.ServerCreateRequest{})
assert.Equal(t, "dummy-server", payload.Name)
assert.Equal(t, int64(114690387), int64(payload.Image.(float64)))
assert.Equal(t, int64(114690387), payload.Image.ID)
assert.Equal(t, "nbg1", payload.Location)
assert.Equal(t, "cpx11", payload.ServerType)
assert.Nil(t, payload.Networks)
Expand Down Expand Up @@ -393,7 +393,7 @@ func TestStepCreateServer(t *testing.T) {
Want: func(t *testing.T, req *http.Request) {
payload := decodeJSONBody(t, req.Body, &schema.ServerCreateRequest{})
assert.Equal(t, "dummy-server", payload.Name)
assert.Equal(t, int64(114690387), int64(payload.Image.(float64)))
assert.Equal(t, int64(114690387), payload.Image.ID)
assert.Equal(t, "nbg1", payload.Location)
assert.Equal(t, "cpx11", payload.ServerType)
assert.Nil(t, payload.Networks)
Expand Down

0 comments on commit 036eef1

Please sign in to comment.