github.com/lmorg/murex@v0.0.0-20240217211045-e081c89cd4ef/builtins/core/httpclient/post_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  // TestPost tests the post function
    11  func TestPost(t *testing.T) {
    12  	count.Tests(t, 1)
    13  
    14  	lang.InitEnv()
    15  	addr := StartHTTPServer(t)
    16  
    17  	p := lang.NewTestProcess()
    18  	p.Config = lang.ShellProcess.Config
    19  	p.Parameters.DefineParsed([]string{addr})
    20  
    21  	err := cmdPost(p)
    22  	if err != nil {
    23  		t.Error(err)
    24  	}
    25  }