~thrrgilag/woodstock

386227562115eb97b0d3225873ecd175581cf610 — Morgan McMillian 3 years ago 5160ad9
Adjust unit tests to fix a full run to complete
4 files changed, 10 insertions(+), 15 deletions(-)

M README.md
M access_token_test.go
M posts_test.go
M users_test.go
M README.md => README.md +2 -0
@@ 2,6 2,8 @@

A golang client library for pnut.io

Based on peanuts, originally written by yukkuri_sinai, this project aims to create a complete supported library.

### Installation

```sh

M access_token_test.go => access_token_test.go +4 -11
@@ 1,12 1,12 @@
package woodstock

import (
	"encoding/json"
	"os"
	"testing"
	"time"
)

const Delay = 15
const Delay = 5 * time.Second

type Config struct {
	ClientID    string


@@ 14,15 14,8 @@ type Config struct {
}

func GetConfig() (config Config, err error) {
	file, err := os.Open("config.json")
	if err != nil {
		return
	}
	decoder := json.NewDecoder(file)
	err = decoder.Decode(&config)
	if err != nil {
		return
	}
	config.ClientID = os.Getenv("PNUT_CLIENT_ID")
	config.AccessToken = os.Getenv("PNUT_ACCESS_TOKEN")
	return
}


M posts_test.go => posts_test.go +2 -2
@@ 96,7 96,7 @@ func TestRevisePost(t *testing.T) {
	if err != nil {
		t.Error(err)
	}
	text := "Hello pnut.io"
	text := "Hello pnut.io."
	new := "Hello pnut.io golang test"
	client := NewClient(config.ClientID, "")
	client.SetAccessToken(config.AccessToken)


@@ 122,7 122,7 @@ func TestDeletePost(t *testing.T) {
	if err != nil {
		t.Error(err)
	}
	text := "Hello pnut.io"
	text := "Hello pnut.io_"
	client := NewClient(config.ClientID, "")
	client.SetAccessToken(config.AccessToken)
	v := url.Values{}

M users_test.go => users_test.go +2 -2
@@ 197,7 197,7 @@ func TestFollow(t *testing.T) {
	if err != nil {
		t.Error(err)
	}
	userID := "494"
	userID := "9"
	client := NewClient(config.ClientID, "")
	client.SetAccessToken(config.AccessToken)
	user, err := client.Follow(userID)


@@ 215,7 215,7 @@ func TestUnFollow(t *testing.T) {
	if err != nil {
		t.Error(err)
	}
	userID := "494"
	userID := "9"
	client := NewClient(config.ClientID, "")
	client.SetAccessToken(config.AccessToken)
	user, err := client.UnFollow(userID)