madon_test.go
author Mikael Berthe <mikael@lilotux.net>
Mon, 28 May 2018 20:51:10 +0200
changeset 226 212a0e74e719
parent 138 23d3a518d0ad
permissions -rw-r--r--
Don't use base64 encoding for header & avatar uploads This should fix https://github.com/McKael/madonctl/issues/14.

package madon

import (
	"testing"

	"github.com/sendgrid/rest"
	"github.com/stretchr/testify/assert"
)

func TestPrepareRequest(t *testing.T) {
	mc := &Client{
		Name:    "foo",
		ID:      "666",
		Secret:  "biiiip",
		APIBase: "http://example.com",
	}

	req, err := mc.prepareRequest("bar", rest.Get, nil)
	assert.NoError(t, err, "no error")
	assert.NotNil(t, req.Headers, "not nil")
}