1
0
mirror of synced 2024-11-22 04:56:06 +03:00

Merge pull request #32 from gwinn/master

remove currency constants
This commit is contained in:
Alex Lushpai 2018-11-08 10:45:33 +03:00 committed by GitHub
commit 0007c39076
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 9 additions and 22 deletions

View File

@ -11,7 +11,7 @@ import (
var (
mgURL = os.Getenv("MG_URL")
mgToken = os.Getenv("MG_TOKEN")
channelId, _ = strconv.ParseUint(os.Getenv("MG_CHANNEL"), 10, 64)
channelID, _ = strconv.ParseUint(os.Getenv("MG_CHANNEL"), 10, 64)
ext = strconv.FormatInt(time.Now().UTC().UnixNano(), 10)
)
@ -34,7 +34,7 @@ func TestMgClient_TransportChannels(t *testing.T) {
func TestMgClient_ActivateTransportChannel(t *testing.T) {
c := client()
ch := Channel{
ID: channelId,
ID: channelID,
Type: "telegram",
Name: "@my_shopping_bot",
Settings: ChannelSettings{
@ -121,7 +121,7 @@ func TestMgClient_ActivateNewTransportChannel(t *testing.T) {
func TestMgClient_UpdateTransportChannel(t *testing.T) {
c := client()
ch := Channel{
ID: channelId,
ID: channelID,
Name: "@my_shopping_bot_2",
Settings: ChannelSettings{
SpamAllowed: false,
@ -170,7 +170,7 @@ func TestMgClient_Messages(t *testing.T) {
Nickname: "octopus",
Firstname: "Joe",
},
Channel: channelId,
Channel: channelID,
ExternalChatID: "24798237492374",
}
@ -196,7 +196,7 @@ func TestMgClient_UpdateMessages(t *testing.T) {
ExternalID: ext,
Text: "hello hello!",
},
channelId,
channelID,
}
dataU, status, err := c.UpdateMessages(sndU)
@ -220,7 +220,7 @@ func TestMgClient_MarkMessageReadAndDelete(t *testing.T) {
MarkMessageReadRequestMessage{
ExternalID: ext,
},
channelId,
channelID,
}
_, status, err := c.MarkMessageRead(snd)
@ -235,7 +235,7 @@ func TestMgClient_MarkMessageReadAndDelete(t *testing.T) {
Message{
ExternalID: ext,
},
channelId,
channelID,
}
data, status, err := c.DeleteMessage(sndD)
@ -249,7 +249,7 @@ func TestMgClient_MarkMessageReadAndDelete(t *testing.T) {
func TestMgClient_DeactivateTransportChannel(t *testing.T) {
c := client()
deleteData, status, err := c.DeactivateTransportChannel(channelId)
deleteData, status, err := c.DeactivateTransportChannel(channelID)
if err != nil {
t.Errorf("%d %v", status, err)

View File

@ -70,7 +70,7 @@ func makeRequest(reqType, url string, buf *bytes.Buffer, c *MgClient) ([]byte, i
}
if resp.StatusCode >= http.StatusInternalServerError {
err = fmt.Errorf("HTTP request error. Status code: %d.\n", resp.StatusCode)
err = fmt.Errorf("http request error. status code: %d", resp.StatusCode)
return res, resp.StatusCode, err
}

View File

@ -39,19 +39,6 @@ const (
MsgOrderStatusCodeComplete = "complete"
// MsgOrderStatusCodeCancel order status group cancel
MsgOrderStatusCodeCancel = "cancel"
// MsgCurrencyRub currency code for russian ruble
MsgCurrencyRub = "rub"
// MsgCurrencyUah currency code for ukrainian hryvnia
MsgCurrencyUah = "uah"
// MsgCurrencyByr currency code for belorussian ruble
MsgCurrencyByr = "byr"
// MsgCurrencyKzt currency code for kazakh tenge
MsgCurrencyKzt = "kzt"
// MsgCurrencyUsd currency code for us dollar
MsgCurrencyUsd = "usd"
// MsgCurrencyEur currency code for euro
MsgCurrencyEur = "eur"
)
// MgClient type