[#4] Change test

TestContract now use covertest invoker.

Signed-off-by: Ekaterina Lebedeva <ekaterina.lebedeva@yadro.com>
This commit is contained in:
Ekaterina Lebedeva 2023-08-08 17:14:07 +03:00
parent 757ab69527
commit 532e9b2d3c

View file

@ -36,7 +36,7 @@ func TestContract(t *testing.T) {
ctrDI := covertest.CompileFile(t, e.CommitteeHash, ctrPath, path.Join(ctrPath, "config.yml")) ctrDI := covertest.CompileFile(t, e.CommitteeHash, ctrPath, path.Join(ctrPath, "config.yml"))
ctr := ctrDI.Contract ctr := ctrDI.Contract
e.DeployContract(t, ctr, nil) e.DeployContract(t, ctr, nil)
inv := e.CommitteeInvoker(ctr.Hash) inv := covertest.CommitteeInvoker(e, ctr.Hash)
// test get without put // test get without put
inv.InvokeFail(t, "Cannot get number", "getNumber", validKey) inv.InvokeFail(t, "Cannot get number", "getNumber", validKey)
@ -48,6 +48,7 @@ func TestContract(t *testing.T) {
// test invalid key // test invalid key
inv.InvokeFail(t, "Invalid key size", "putNumber", invalidKey, 42) inv.InvokeFail(t, "Invalid key size", "putNumber", invalidKey, 42)
inv.InvokeFail(t, "Invalid key size", "getNumber", invalidKey) inv.InvokeFail(t, "Invalid key size", "getNumber", invalidKey)
spew.Dump(inv.Methods)
} }
func TestRun(t *testing.T) { func TestRun(t *testing.T) {