cloudflare/Cloudflare-Pivotal-Cloud-Foundry

Public

mirrored fromhttps://github.com/cloudflare/Cloudflare-Pivotal-Cloud-Foundry

CodeCommitsIssuesPull requestsActionsInsightsSecurity
3679cedc2a32d0b5feb187a966f7f417953707b2

Branches

Tags

  • No tags available.
0Branches0Tags
Go to file
Add file
Code

Clone

HTTPS

Download ZIP

api/cloudflare_test.go

33lines · modecode

1package api_test
2
3import (
4 "reflect"
5 "testing"
6
7 "github.com/cloudflare/Cloudflare-Pivotal-Cloud-Foundry/api"
8)
9
10func TestGetAuthHeaders(t *testing.T) {
11 email := "my@email.com"
12 key := "myKey"
13 auth := api.AuthHeaders{XAuthEmail: email, XAuthKey: key}
14 testApi := api.CloudflareAPI{Auth: auth}
15 testApi.Auth = auth
16
17 result := testApi.GetAuthHeaders()
18 if !reflect.DeepEqual(result, auth) {
19 t.Errorf("GetAuthHeaders failed")
20 }
21}
22
23func TestSetAuthHeaders(t *testing.T) {
24 email := "my@email.com"
25 key := "myKey"
26 auth := api.AuthHeaders{XAuthEmail: email, XAuthKey: key}
27 testApi := api.CloudflareAPI{}
28
29 testApi.SetAuthHeaders(auth)
30 if !reflect.DeepEqual(testApi.Auth, auth) {
31 t.Errorf("TestSetAuthHeaders failed")
32 }
33}