From 21874c403c7b04da9cf408a42dfd7aab6ae3177d Mon Sep 17 00:00:00 2001 From: venomade Date: Mon, 16 Dec 2024 20:24:06 +0000 Subject: Initial Commit --- main_test.go | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 main_test.go (limited to 'main_test.go') diff --git a/main_test.go b/main_test.go new file mode 100644 index 0000000..a9386d0 --- /dev/null +++ b/main_test.go @@ -0,0 +1,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) + } +} -- cgit 1.4.1-2-gfad0