func main() { flag.Parse() if len(flag.Args()) < 1 { log.Fatal("Usage:\n dropboxfs MOUNTPOINT") } err := fs.LoadConfig() if err != nil { log.Fatalf("Config fail: %v\n", err) } fs.CacheInit() fs.MountFs(flag.Arg(0)) }
func TestMetadataGet(t *testing.T) { assert := assert.New(t) fs.CacheInit() // Check that cache is currently empty assert.Exactly(fs.Metadata{}, fs.Cache.Metadata.Data[upload_path]) metadata, err := fs.Cache.Metadata.Get(upload_path) assert.NoError(err) assert.NotEmpty(metadata) assert.NotEmpty(fs.Cache.Metadata.Data[upload_path]) }
func TestCacheInit(t *testing.T) { fs.CacheInit() metadata := fs.Metadata{Path: "/hello/world"} fs.Cache.Metadata.Data["hello"] = metadata assert.Exactly(t, metadata, fs.Cache.Metadata.Data["hello"]) }