MCPcopy Create free account
hub / github.com/Driver-C/tryssh / TestCreateTestKnownHosts

Function TestCreateTestKnownHosts

testutil/helpers_test.go:33–41  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

31}
32
33func TestCreateTestKnownHosts(t *testing.T) {
34 dir := t.TempDir()
35 content := "192.168.1.1 ssh-ed25519 AAAA..."
36 path := CreateTestKnownHosts(t, dir, content)
37 assert.Equal(t, filepath.Join(dir, "known_hosts"), path)
38
39 result := ReadFile(t, path)
40 assert.Equal(t, content, result)
41}
42
43func TestCreateTestKnownHosts_EmptyContent(t *testing.T) {
44 dir := t.TempDir()

Callers

nothing calls this directly

Calls 2

CreateTestKnownHostsFunction · 0.85
ReadFileFunction · 0.70

Tested by

no test coverage detected