mirror of
https://github.com/lightninglabs/loop.git
synced 2026-08-13 12:33:03 +02:00
misc: refactor loop tests to use require where possible
This commit is contained in:
parent
bdb4b773ed
commit
049b17ff96
10 changed files with 100 additions and 193 deletions
|
|
@ -140,9 +140,8 @@ func (ctx *testContext) finish() {
|
|||
ctx.stop()
|
||||
select {
|
||||
case err := <-ctx.runErr:
|
||||
if err != nil {
|
||||
ctx.T.Fatal(err)
|
||||
}
|
||||
require.NoError(ctx.T, err)
|
||||
|
||||
case <-time.After(test.Timeout):
|
||||
ctx.T.Fatal("client not stopping")
|
||||
}
|
||||
|
|
@ -156,19 +155,12 @@ func (ctx *testContext) finish() {
|
|||
func (ctx *testContext) notifyHeight(height int32) {
|
||||
ctx.T.Helper()
|
||||
|
||||
if err := ctx.Lnd.NotifyHeight(height); err != nil {
|
||||
ctx.T.Fatal(err)
|
||||
}
|
||||
require.NoError(ctx.T, ctx.Lnd.NotifyHeight(height))
|
||||
}
|
||||
|
||||
func (ctx *testContext) assertIsDone() {
|
||||
if err := ctx.Lnd.IsDone(); err != nil {
|
||||
ctx.T.Fatal(err)
|
||||
}
|
||||
|
||||
if err := ctx.store.isDone(); err != nil {
|
||||
ctx.T.Fatal(err)
|
||||
}
|
||||
require.NoError(ctx.T, ctx.Lnd.IsDone())
|
||||
require.NoError(ctx.T, ctx.store.isDone())
|
||||
|
||||
select {
|
||||
case <-ctx.statusChan:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue