madon_test.go
author Mikael Berthe <mikael@lilotux.net>
Tue, 20 Mar 2018 00:24:41 +0100
changeset 210 3f1f5cb7ae70
parent 138 23d3a518d0ad
permissions -rw-r--r--
Initial instance statistics (peers/activity) support

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")
}