summary refs log tree commit diff
path: root/main_test.go
diff options
context:
space:
mode:
Diffstat (limited to 'main_test.go')
-rw-r--r--main_test.go26
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)
+	}
+}