Refactoring n shit

This commit is contained in:
y a t s
2026-06-06 17:30:09 -04:00
parent 412f3108e1
commit 15541fb0da
9 changed files with 428 additions and 249 deletions
+2 -27
View File
@@ -21,7 +21,7 @@ func TestGetPage(t *testing.T) {
ctx := t.Context()
t.Log("Getting homepage\n")
resp, err := kf.GetPage(ctx, kf.domain)
resp, err := kf.Get(ctx, kf.domain)
if err != nil {
t.Error(err)
return
@@ -58,7 +58,7 @@ func TestGetPost(t *testing.T) {
}
func newTestKF() (*KF, error) {
host := os.Getenv("KF_HOST")
host := os.Getenv("TEST_HOST")
if host == "" {
host = _TEST_HOST
}
@@ -85,28 +85,3 @@ func newTestKF() (*KF, error) {
return NewKF(hc, u)
}
func TestLogin(t *testing.T) {
user, pass := os.Getenv("TEST_USER"), os.Getenv("TEST_PASS")
if user == "" || pass == "" {
t.Log("TEST_USER and/or TEST_PASS empty. Skipping.\n")
return
}
kf, err := newTestKF()
if err != nil {
t.Error(err)
return
}
ctx := t.Context()
resp, err := kf.Login(ctx, user, pass)
if err != nil {
t.Error(err)
return
}
defer resp.Body.Close()
t.Logf("Login response: %+v\n", resp)
}