Skip to content

Commit

Permalink
add test for SetDeviceIPv4Address
Browse files Browse the repository at this point in the history
Signed-off-by: Cameron Stokes <[email protected]>
  • Loading branch information
clstokes committed May 16, 2024
1 parent 55608f2 commit 0af49ad
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions tailscale/client_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -975,6 +975,19 @@ func TestClient_SetDeviceKey(t *testing.T) {
assert.EqualValues(t, expected, actual)

}
func TestClient_SetDeviceIPv4Address(t *testing.T) {
t.Parallel()

client, server := NewTestHarness(t)
server.ResponseCode = http.StatusOK

const deviceID = "test"
address := "100.64.0.1"

assert.NoError(t, client.SetDeviceIPv4Address(context.Background(), deviceID, address))
assert.Equal(t, http.MethodPost, server.Method)
assert.EqualValues(t, "/api/v2/device/"+deviceID+"/ip", server.Path)
}

func TestErrorData(t *testing.T) {
t.Parallel()
Expand Down

0 comments on commit 0af49ad

Please sign in to comment.