Ash Wilson | 31844f2 | 2014-09-08 15:32:58 -0400 | [diff] [blame] | 1 | package v2 |
Samuel A. Falvo II | 8a549ef | 2014-01-24 15:20:54 -0800 | [diff] [blame] | 2 | |
| 3 | import ( |
| 4 | "encoding/json" |
| 5 | "testing" |
| 6 | ) |
| 7 | |
| 8 | func TestAccessToken(t *testing.T) { |
| 9 | authResults := make(map[string]interface{}) |
| 10 | err := json.Unmarshal([]byte(authResultsOK), &authResults) |
| 11 | if err != nil { |
| 12 | t.Error(err) |
| 13 | return |
| 14 | } |
| 15 | |
Samuel A. Falvo II | 2b96321 | 2014-02-09 02:12:30 -0800 | [diff] [blame] | 16 | tok, err := GetToken(authResults) |
Samuel A. Falvo II | 8a549ef | 2014-01-24 15:20:54 -0800 | [diff] [blame] | 17 | if err != nil { |
| 18 | t.Error(err) |
| 19 | return |
| 20 | } |
Ash Wilson | 12b3b6c | 2014-09-08 14:54:38 -0400 | [diff] [blame] | 21 | if tok.ID != "ab48a9efdfedb23ty3494" { |
| 22 | t.Errorf("Expected token \"ab48a9efdfedb23ty3494\"; got \"%s\" instead", tok.ID) |
Samuel A. Falvo II | 8a549ef | 2014-01-24 15:20:54 -0800 | [diff] [blame] | 23 | return |
| 24 | } |
| 25 | } |