Example #1
0
func Test_GetUserEmailByUID(t *testing.T) {
	a := assert.New(t)
	info := &dropbox.AccountInfo{
		Email:       "*****@*****.**",
		Uid:         1234,
		DisplayName: "pippo",
	}
	token := dropbox.AccessToken{Key: "a", Secret: "b"}
	datastore.SaveUserData(info, token)

	email, _ := datastore.GetUserEmailByUID(1234)
	a.Equal(email, "*****@*****.**")

	_, err := datastore.GetUserEmailByUID(1)
	a.NotEqual(err, nil)
}
Example #2
0
func processChanges(users []int) {
	for _, v := range users {
		email, err := datastore.GetUserEmailByUID(v)
		if err == nil {
			go processUserDelta(email)
		}
	}

}