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