first commit

This commit is contained in:
didier amyot committed 2014-12-07 18:36:53 -08:00
commit a617cf50ee
8 files changed
+799

No files matched your search

+21
View File
@@ -0,0 +1,21 @@
package main
import "testing"
func TestcreateGetPathAndParams(t *testing.T) {
tw := NewTwitterApi("twitter.com", "access_token")
p := map[string]string{"hello": "world"}
if u := tw.createGetPathAndParams("bob/foo", p); u != "bob/foo?hello=world" {
t.Error("bad url", u)
}
}
func TestGetBase64EncodedBearerTokenCredentials(t *testing.T) {
key := "xvz1evFS4wEEPTGEFPHBog"
secret := "L8qq9PZyRg6ieKGEKhZolGC0vJWLw8iEJ88DRdyOg"
expt := "eHZ6MWV2RlM0d0VFUFRHRUZQSEJvZzpMOHFxOVBaeVJnNmllS0dFS2hab2xHQzB2SldMdzhpRUo4OERSZHlPZw=="
tapi := new(TwitterApi)
if res := tapi.GetBase64EncodedBearerTokenCredentials(key, secret); res != expt {
t.Error("expected: ", expt, "\nbut received:", res)
}
}