From b031d87daf1d8e8306378f72b8f1db9f36ce9085 Mon Sep 17 00:00:00 2001 From: "Johan T. Halseth" Date: Tue, 21 Aug 2018 12:53:56 +0200 Subject: [PATCH] contractcourt/briefcase: test FetchContractResolutions error when no resolutions logged --- contractcourt/briefcase_test.go | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/contractcourt/briefcase_test.go b/contractcourt/briefcase_test.go index 622fba2c1..5010cde9e 100644 --- a/contractcourt/briefcase_test.go +++ b/contractcourt/briefcase_test.go @@ -532,6 +532,13 @@ func TestContractResolutionsStorage(t *testing.T) { }, } + // First make sure that fetching unlogged contract resolutions will + // fail. + _, err = testLog.FetchContractResolutions() + if err == nil { + t.Fatalf("expected reading unlogged resolution from db to fail") + } + // Insert the resolution into the database, then immediately retrieve // them so we can compare equality against the original version. if err := testLog.LogContractResolutions(&res); err != nil {