config_test.go 333 Bytes
Newer Older
Juan Batiz-Benet's avatar
Juan Batiz-Benet committed
1 2 3
package config

import (
Juan Batiz-Benet's avatar
gofmt  
Juan Batiz-Benet committed
4 5
	"fmt"
	"testing"
Juan Batiz-Benet's avatar
Juan Batiz-Benet committed
6 7 8
)

func TestConfig(t *testing.T) {
Brian Tiger Chow's avatar
Brian Tiger Chow committed
9 10 11 12 13 14 15
	const filename = ".ipfsconfig"
	cfgWritten := new(Config)
	err := WriteConfigFile(filename, cfgWritten)
	if err != nil {
		t.Error(err)
	}
	cfgRead, err := Load(filename)
Juan Batiz-Benet's avatar
gofmt  
Juan Batiz-Benet committed
16 17 18 19
	if err != nil {
		t.Error(err)
		return
	}
Juan Batiz-Benet's avatar
Juan Batiz-Benet committed
20

Brian Tiger Chow's avatar
Brian Tiger Chow committed
21
	fmt.Printf(cfgRead.Datastore.Path)
Juan Batiz-Benet's avatar
Juan Batiz-Benet committed
22
}