@@ -13,9 +13,11 @@ func Test_TransformPostBatchURL_Secure(t *testing.T) {
13
13
Insecure : false ,
14
14
}
15
15
16
- url := "https://example.com/"
16
+ rawURL := "https://example.com/"
17
+ actualURL , err := uploader .TransformPostBatchURL (rawURL )
17
18
18
- r .Equal ("https://example.com/" , uploader .TransformPostBatchURL (url ))
19
+ r .Equal ("https://example.com/" , actualURL )
20
+ r .Nil (err )
19
21
}
20
22
func Test_TransformPostBatchURL_Insecure_Success (t * testing.T ) {
21
23
r := require .New (t )
@@ -24,9 +26,11 @@ func Test_TransformPostBatchURL_Insecure_Success(t *testing.T) {
24
26
Insecure : true ,
25
27
}
26
28
27
- url := "https://example.com/"
29
+ rawURL := "https://example.com/"
30
+ actualURL , err := uploader .TransformPostBatchURL (rawURL )
28
31
29
- r .Equal ("http://example.com/" , uploader .TransformPostBatchURL (url ))
32
+ r .Equal ("http://example.com/" , actualURL )
33
+ r .Nil (err )
30
34
}
31
35
32
36
func Test_TransformPostBatchURL_Insecure_Error (t * testing.T ) {
@@ -36,7 +40,9 @@ func Test_TransformPostBatchURL_Insecure_Error(t *testing.T) {
36
40
Insecure : true ,
37
41
}
38
42
39
- url := "://example.com/"
43
+ rawURL := "://example.com/"
44
+ actualURL , err := uploader .TransformPostBatchURL (rawURL )
40
45
41
- r .Equal (url , uploader .TransformPostBatchURL (url ))
46
+ r .Equal ("" , actualURL )
47
+ r .Equal ("parse ://example.com/: missing protocol scheme" , err .Error ())
42
48
}
0 commit comments