mirror of
https://github.com/go-kratos/kratos.git
synced 2025-03-17 21:07:54 +02:00
test: add paladin config one level symbolic file link (#452)
This commit is contained in:
parent
07e25cf875
commit
e8e05452b3
@ -116,7 +116,6 @@ func TestHiddenFile(t *testing.T) {
|
||||
number = 100
|
||||
`), 0644))
|
||||
// test client
|
||||
// test client
|
||||
cli, err := NewFile(path)
|
||||
assert.Nil(t, err)
|
||||
assert.NotNil(t, cli)
|
||||
@ -129,3 +128,19 @@ func TestHiddenFile(t *testing.T) {
|
||||
_, err = cli.Get(".abc.toml").String()
|
||||
assert.NotNil(t, err)
|
||||
}
|
||||
|
||||
func TestOneLevelSymbolicFile(t *testing.T) {
|
||||
path := "/tmp/test_symbolic_link/"
|
||||
path2 := "/tmp/test_symbolic_link/configs/"
|
||||
assert.Nil(t, os.MkdirAll(path2, 0700))
|
||||
assert.Nil(t, ioutil.WriteFile(path+"test.toml", []byte(`hello`), 0644))
|
||||
assert.Nil(t, os.Symlink(path+"test.toml", path2+"test.toml.ln"))
|
||||
// test client
|
||||
cli, err := NewFile(path2)
|
||||
assert.Nil(t, err)
|
||||
assert.NotNil(t, cli)
|
||||
content, _ := cli.Get("test.toml.ln").String()
|
||||
assert.Equal(t, "hello", content)
|
||||
os.Remove(path+"test.toml")
|
||||
os.Remove(path2+"test.toml.ln")
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user