Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Add TestDelete to settings_test.go
  • Loading branch information
MatteoPologruto committed Jun 27, 2023
commit 2ef668ce266b4e404a5c6857215bd1bd516fd37b
15 changes: 15 additions & 0 deletions commands/daemon/settings_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -157,3 +157,18 @@ func TestWrite(t *testing.T) {
// We don't verify the content since we expect config library, Viper, to work
require.True(t, configFile.Exist())
}

func TestDelete(t *testing.T) {
_, err := svc.Delete(context.Background(), &rpc.DeleteRequest{
Key: "doesnotexist",
})
require.Error(t, err)

_, err = svc.Delete(context.Background(), &rpc.DeleteRequest{
Key: "network",
})
require.NoError(t, err)

_, err = svc.GetValue(context.Background(), &rpc.GetValueRequest{Key: "network"})
require.Error(t, err)
}
3 changes: 3 additions & 0 deletions commands/daemon/testdata/arduino-cli.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,6 @@ logging:
file: ""
format: text
level: info

network:
proxy: "123"