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