diff options
author | venomade <venomade@venomade.com> | 2024-12-16 20:24:06 +0000 |
---|---|---|
committer | venomade <venomade@venomade.com> | 2024-12-16 20:24:06 +0000 |
commit | 21874c403c7b04da9cf408a42dfd7aab6ae3177d (patch) | |
tree | f70ec15514b0a5b0ffdf92cb3b2eccba88cc982e /main_test.go |
Initial Commit
Diffstat (limited to 'main_test.go')
-rw-r--r-- | main_test.go | 26 |
1 files changed, 26 insertions, 0 deletions
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) + } +} |