(t *testing.T)
| 398 | } |
| 399 | |
| 400 | func TestHttpProxyAlreadyStarted(t *testing.T) { |
| 401 | sess, _ := createMockSession() |
| 402 | mod := NewHttpProxy(sess) |
| 403 | |
| 404 | // Configure |
| 405 | sess.Env.Set("http.port", "80") |
| 406 | sess.Env.Set("http.proxy.address", "127.0.0.1") |
| 407 | sess.Env.Set("http.proxy.port", "0") |
| 408 | sess.Env.Set("http.proxy.redirect", "false") |
| 409 | |
| 410 | // Start the proxy |
| 411 | err := mod.Start() |
| 412 | if err != nil { |
| 413 | t.Fatalf("Failed to start proxy: %v", err) |
| 414 | } |
| 415 | |
| 416 | // Try to configure while running |
| 417 | err = mod.Configure() |
| 418 | if err == nil { |
| 419 | t.Error("Configure should fail when proxy is already running") |
| 420 | } |
| 421 | |
| 422 | // Stop the proxy |
| 423 | mod.Stop() |
| 424 | } |
| 425 | |
| 426 | func TestHTTPProxyDoProxy(t *testing.T) { |
| 427 | sess, _ := createMockSession() |
nothing calls this directly
no test coverage detected