Add a patch to remove a test with a missing dep
Sophie Brun
5 years ago
|
0 |
Description: Remove http_test
|
|
1 |
Remove http_test as it requires github.com/h2non/gock not packaged in
|
|
2 |
Kali.
|
|
3 |
Author: Sophie Brun <[email protected]>
|
|
4 |
Last-Update: 2018-08-30
|
|
5 |
---
|
|
6 |
This patch header follows DEP-3: http://dep.debian.net/deps/dep3/
|
|
7 |
--- a/libgobuster/http_test.go
|
|
8 |
+++ /dev/null
|
|
9 |
@@ -1,34 +0,0 @@
|
|
10 |
-package libgobuster
|
|
11 |
-
|
|
12 |
-import (
|
|
13 |
- "context"
|
|
14 |
- "testing"
|
|
15 |
-
|
|
16 |
- "github.com/h2non/gock"
|
|
17 |
-)
|
|
18 |
-
|
|
19 |
-func TestMakeRequest(t *testing.T) {
|
|
20 |
- defer gock.Off()
|
|
21 |
- gock.New("http://server.com").
|
|
22 |
- Get("/bar").
|
|
23 |
- Reply(200).
|
|
24 |
- BodyString("test")
|
|
25 |
-
|
|
26 |
- o := NewOptions()
|
|
27 |
- c, err := newHTTPClient(context.Background(), o)
|
|
28 |
- if err != nil {
|
|
29 |
- t.Fatalf("Got Error: %v", err)
|
|
30 |
- }
|
|
31 |
- gock.InterceptClient(c.client)
|
|
32 |
- defer gock.RestoreClient(c.client)
|
|
33 |
- a, b, err := c.makeRequest("http://server.com/bar", "")
|
|
34 |
- if err != nil {
|
|
35 |
- t.Fatalf("Got Error: %v", err)
|
|
36 |
- }
|
|
37 |
- if *a != 200 {
|
|
38 |
- t.Fatalf("Invalid status returned: %d", a)
|
|
39 |
- }
|
|
40 |
- if b != nil && *b != int64(len("test")) {
|
|
41 |
- t.Fatalf("Invalid length returned: %d", b)
|
|
42 |
- }
|
|
43 |
-}
|