Permalink
Browse files

Okay, gotest is pretty nifty

  • Loading branch information...
1 parent b6ed623 commit 7998341795e092e189de2b23af5df2efee5a6173 @mncaudill committed Jan 18, 2011
Showing with 17 additions and 10 deletions.
  1. +3 −0 README
  2. +14 −10 flickr_test.go
View
3 README
@@ -17,6 +17,9 @@ To compile and install:
make
make install
+To test:
+gotest
+
=======================================================================
PACKAGE
View
@@ -1,21 +1,25 @@
-package main
+package flickr
import (
- "flickr"
"fmt"
+ "testing"
)
-func main() {
- r := new(flickr.Request)
- r.ApiKey = "YOURAPIKEYHERE"
-
- r.Args = map[string]string{
- "auth_token": "YOURAUTHTOKENHERE",
- "title": "Good mornin'",
+func TestGetInfo(t *testing.T) {
+ r := &Request{
+ ApiKey: "YOURAPIKEYHERE",
+ Method: "flickr.photos.getInfo",
+ Args: map[string]string{
+ "photo_id": "5356343650",
+ },
}
+ // Don't need to sign but might as well since we're testing
r.Sign("YOURAPISECRETHERE")
- resp, err := r.Upload("thumb.jpg", "image/jpeg")
+
+ fmt.Println(r.URL())
+
+ resp, err := r.Execute()
if err != nil {
fmt.Println(err)
}

0 comments on commit 7998341

Please sign in to comment.