status-go/server/pairing
Eng Zer Jun 83ad76637a
test: use `T.TempDir` to create temporary test directory (#2746)
This commit replaces `os.MkdirTemp` with `t.TempDir` in tests. The
directory created by `t.TempDir` is automatically removed when the test
and all its subtests complete.

Prior to this commit, temporary directory created using `os.MkdirTemp`
needs to be removed manually by calling `os.RemoveAll`, which is omitted
in some tests. The error handling boilerplate e.g.
	defer func() {
		if err := os.RemoveAll(dir); err != nil {
			t.Fatal(err)
		}
	}
is also tedious, but `t.TempDir` handles this for us nicely.

Reference: https://pkg.go.dev/testing#T.TempDir

Signed-off-by: Eng Zer Jun <engzerjun@gmail.com>
2023-04-26 21:39:51 +01:00
..
peers Added versioning package and addressed feedback 2023-04-17 12:01:38 +01:00
versioning Added versioning package and addressed feedback 2023-04-17 12:01:38 +01:00
certs.go Reconciled duplicate cert funcs 2023-03-24 17:31:34 +00:00
certs_test.go Reconciled duplicate cert funcs 2023-03-24 17:31:34 +00:00
challenge_management.go Addressed feedback from @ilmotta 2023-03-24 16:47:43 +00:00
client.go Refactored BasePayloadReceiver to handle Receive() 2023-04-04 11:56:40 +01:00
common.go add validation on config (#3350) 2023-03-29 23:51:01 +08:00
components_test.go Reconciled duplicate cert funcs 2023-03-24 17:31:34 +00:00
config.go add validation on config (#3350) 2023-03-29 23:51:01 +08:00
config_test.go add validation on config (#3350) 2023-03-29 23:51:01 +08:00
connection.go Added versioning package and addressed feedback 2023-04-17 12:01:38 +01:00
connection_test.go Removed server mode from pairing 2023-03-24 17:53:29 +00:00
events.go fix(pairing): Received installation event (#3422) 2023-04-26 14:48:49 +03:00
handlers.go Removed HandlerServer interface 2023-04-04 15:29:13 +01:00
interfaces.go Removed HandlerServer interface 2023-04-04 15:29:13 +01:00
payload_encryptor.go Refactored BasePayloadReceiver to handle Receive() 2023-04-04 11:56:40 +01:00
payload_management.go Refactored BasePayloadReceiver to handle Receive() 2023-04-04 11:56:40 +01:00
payload_management_test.go test: use `T.TempDir` to create temporary test directory (#2746) 2023-04-26 21:39:51 +01:00
payload_mounter.go Refactored BasePayloadReceiver to handle Receive() 2023-04-04 11:56:40 +01:00
payload_receiver.go fix(pairing): Received installation event (#3422) 2023-04-26 14:48:49 +03:00
peers.go Added functionality to slow stop UDP beacon multicast/listen 2023-04-17 12:01:38 +01:00
raw_message_collector.go Refactored BasePayloadReceiver to handle Receive() 2023-04-04 11:56:40 +01:00
raw_message_handler.go fix(pairing): Received installation event (#3422) 2023-04-26 14:48:49 +03:00
server.go Removed HandlerServer interface 2023-04-04 15:29:13 +01:00
server_pairing_test.go Removed server mode from pairing 2023-03-24 17:53:29 +00:00
sync_device_test.go test: use `T.TempDir` to create temporary test directory (#2746) 2023-04-26 21:39:51 +01:00
utils.go fix(pairing): Received installation event (#3422) 2023-04-26 14:48:49 +03:00