summary refs log tree commit diff
path: root/main_test.go
blob: a9386d04302cfe9014f3fb46beea9c1dac4bd418 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
package main

import (
	"fmt"
	"os"
	"testing"
)

func TestOAuth(t *testing.T) {
	result := GetOAuth(clientID, "/home/venomade/.local/share/lifesigns/auth")
	if result != "" {
		fmt.Println("OAuth: ", result)
	} else {
		t.Errorf("OAuth should be a code, got %s", result)
	}
}

func TestOAuthNoFile(t *testing.T) {
	os.Remove("/home/venomade/.local/share/lifesigns/auth")
	result := GetOAuth(clientID, "/home/venomade/.local/share/lifesigns/auth")
	if result != "" {
		fmt.Println("OAuth: ", result)
	} else {
		t.Errorf("OAuth should be a code, got %s", result)
	}
}