blob: 7e106fdbf6414f80d80a146c75723fbbbc4128fc (
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
27
28
29
30
31
32
|
package main
import (
"fmt"
"os"
"testing"
)
func TestOAuth(t *testing.T) {
result, err := GetOAuth()
if err != nil {
t.Error(err)
}
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, err := GetOAuth()
if err != nil {
t.Error(err)
}
if result != "" {
fmt.Println("OAuth: ", result)
} else {
t.Errorf("OAuth should be a code, got %s", result)
}
}
|