Samuel A. Falvo II | 8a549ef | 2014-01-24 15:20:54 -0800 | [diff] [blame^] | 1 | package identity |
| 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 | |
| 16 | tok, err := Token(authResults) |
| 17 | if err != nil { |
| 18 | t.Error(err) |
| 19 | return |
| 20 | } |
| 21 | if tok.Id() != "ab48a9efdfedb23ty3494" { |
| 22 | t.Errorf("Expected token \"ab48a9efdfedb23ty3494\"; got \"%s\" instead", tok.Id()) |
| 23 | return |
| 24 | } |
| 25 | } |