-
Notifications
You must be signed in to change notification settings - Fork 80
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
using log.Printf() instead of fmt.Printf()
- Loading branch information
1 parent
f9fb82e
commit 7cf2f3e
Showing
8 changed files
with
33 additions
and
41 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,7 +2,6 @@ package main | |
|
||
import ( | ||
"encoding/json" | ||
//"errors" | ||
"fmt" | ||
"time" | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,6 +2,7 @@ package main | |
|
||
import ( | ||
"fmt" | ||
"log" | ||
"io/ioutil" | ||
"net/http" | ||
"net/http/httptest" | ||
|
@@ -98,7 +99,7 @@ func TestUtilSMS(t *testing.T) { | |
rw.WriteHeader(200) | ||
defer req.Body.Close() | ||
bodyBytes, _ := ioutil.ReadAll(req.Body) | ||
fmt.Printf("body: %s\n", string(bodyBytes)) | ||
log.Printf("body: %s\n", string(bodyBytes)) | ||
if string(bodyBytes) != "Body=Data+Bunker+code+1234&From=from1234&To=4444" { | ||
t.Fatalf("bad request: %s", string(bodyBytes)) | ||
} | ||
|
@@ -118,7 +119,7 @@ func TestUtilNotifyConsentChange(t *testing.T) { | |
rw.WriteHeader(200) | ||
defer req.Body.Close() | ||
bodyBytes, _ := ioutil.ReadAll(req.Body) | ||
fmt.Printf("body: %s\n", string(bodyBytes)) | ||
log.Printf("body: %s\n", string(bodyBytes)) | ||
if string(bodyBytes) != `{"action":"consentchange","brief":"brief","identity":"[email protected]","mode":"email","status":"no"}` { | ||
q <- fmt.Sprintf("bad request in notifyConsentChange: %s", string(bodyBytes)) | ||
} else { | ||
|
@@ -141,7 +142,7 @@ func TestUtilNotifyProfileNew(t *testing.T) { | |
rw.WriteHeader(200) | ||
defer req.Body.Close() | ||
bodyBytes, _ := ioutil.ReadAll(req.Body) | ||
fmt.Printf("body: %s\n", string(bodyBytes)) | ||
log.Printf("body: %s\n", string(bodyBytes)) | ||
if string(bodyBytes) != `{"action":"profilenew","identity":"[email protected]","mode":"email","profile":{"name":"alex"}}` { | ||
q <- fmt.Sprintf("bad request in notifyConsentChange: %s", string(bodyBytes)) | ||
} else { | ||
|
@@ -165,7 +166,7 @@ func TestUtilNotifyForgetMe(t *testing.T) { | |
rw.WriteHeader(200) | ||
defer req.Body.Close() | ||
bodyBytes, _ := ioutil.ReadAll(req.Body) | ||
fmt.Printf("body: %s\n", string(bodyBytes)) | ||
log.Printf("body: %s\n", string(bodyBytes)) | ||
if string(bodyBytes) != `{"action":"forgetme","identity":"[email protected]","mode":"email","profile":{"name":"alex"}}` { | ||
q <- fmt.Sprintf("bad request in notifyConsentChange: %s", string(bodyBytes)) | ||
} else { | ||
|
@@ -189,7 +190,7 @@ func TestUtilNotifyProfileChange(t *testing.T) { | |
rw.WriteHeader(200) | ||
defer req.Body.Close() | ||
bodyBytes, _ := ioutil.ReadAll(req.Body) | ||
fmt.Printf("body: %s\n", string(bodyBytes)) | ||
log.Printf("body: %s\n", string(bodyBytes)) | ||
if string(bodyBytes) != `{"action":"profilechange","identity":"[email protected]","mode":"email","old":{"name":"alex2"},"profile":{"name":"alex3"}}` { | ||
q <- fmt.Sprintf("bad request in notifyConsentChange: %s", string(bodyBytes)) | ||
} else { | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters