-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
plugin: add tests to test the plugins
Signed-off-by: Vincenzo Palazzo <[email protected]>
- Loading branch information
1 parent
3b33db3
commit 0022e0e
Showing
2 changed files
with
26 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
package plugin | ||
|
||
import ( | ||
"os" | ||
"testing" | ||
|
||
"github.com/vincenzopalazzo/cln4go/client" | ||
) | ||
|
||
func TestCallFistMethod(t *testing.T) { | ||
path := os.Getenv("CLN_UNIX_SOCKET") | ||
client, err := client.NewUnix(path) | ||
if err != nil { | ||
panic(err) | ||
} | ||
response, err := client.Call("hello", make(map[string]interface{})) | ||
message, found := response["message"] | ||
if !found { | ||
t.Error("The message is not found") | ||
} | ||
|
||
if message != "hello from go 1.18" { | ||
t.Error("message received %s different from expected %s", message, "hello from go 1.18") | ||
} | ||
} |