mirror of
https://github.com/ipfs/kubo.git
synced 2025-09-16 04:02:05 +08:00
25 lines
434 B
Go
25 lines
434 B
Go
package config
|
|
|
|
import (
|
|
"testing"
|
|
)
|
|
|
|
func TestConfig(t *testing.T) {
|
|
const filename = ".ipfsconfig"
|
|
const dsPath = "/path/to/datastore"
|
|
cfgWritten := new(Config)
|
|
cfgWritten.Datastore.Path = dsPath
|
|
err := WriteConfigFile(filename, cfgWritten)
|
|
if err != nil {
|
|
t.Error(err)
|
|
}
|
|
cfgRead, err := Load(filename)
|
|
if err != nil {
|
|
t.Error(err)
|
|
return
|
|
}
|
|
if cfgWritten.Datastore.Path != cfgRead.Datastore.Path {
|
|
t.Fail()
|
|
}
|
|
}
|