github.com/lmorg/murex@v0.0.0-20240217211045-e081c89cd4ef/builtins/core/httpclient/get_test.go (about)

     1  package httpclient
     2  
     3  import (
     4  	"testing"
     5  
     6  	"github.com/lmorg/murex/lang"
     7  	"github.com/lmorg/murex/test/count"
     8  )
     9  
    10  // TestGet tests the get function
    11  func TestGet(t *testing.T) {
    12  	count.Tests(t, 1)
    13  
    14  	lang.InitEnv()
    15  	addr := StartHTTPServer(t)
    16  
    17  	p := lang.NewTestProcess()
    18  	p.Parameters.DefineParsed([]string{addr})
    19  
    20  	err := cmdGet(p)
    21  	if err != nil {
    22  		t.Error(err)
    23  	}
    24  }
    25  
    26  // TestGetFile tests the getfile function
    27  func TestGetFile(t *testing.T) {
    28  	count.Tests(t, 1)
    29  
    30  	lang.InitEnv()
    31  	addr := StartHTTPServer(t)
    32  
    33  	p := lang.NewTestProcess()
    34  	p.Parameters.DefineParsed([]string{addr})
    35  
    36  	err := cmdGetFile(p)
    37  	if err != nil {
    38  		t.Error(err)
    39  	}
    40  }