From e6fe9c21160d4bbd16b5fac2c95a68bf987a6152 Mon Sep 17 00:00:00 2001 From: Brett Smith Date: Wed, 18 Jan 2023 14:33:41 -0500 Subject: [PATCH] 19886: DRY up test code for better readability Arvados-DCO-1.1-Signed-off-by: Brett Smith --- lib/crunchrun/crunchrun_test.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/crunchrun/crunchrun_test.go b/lib/crunchrun/crunchrun_test.go index 20ce8c647d..08bfcdfecf 100644 --- a/lib/crunchrun/crunchrun_test.go +++ b/lib/crunchrun/crunchrun_test.go @@ -916,8 +916,9 @@ func (s *TestSuite) TestCommitNodeInfoBeforeStart(c *C) { }) c.Assert(collection_create, NotNil) - c.Check(collection_create["collection"].(arvadosclient.Dict)["name"], Equals, "logs for zzzzz-dz642-202301121543210") - manifest_text := collection_create["collection"].(arvadosclient.Dict)["manifest_text"] + log_collection := collection_create["collection"].(arvadosclient.Dict) + c.Check(log_collection["name"], Equals, "logs for zzzzz-dz642-202301121543210") + manifest_text := log_collection["manifest_text"].(string) // We check that the file size is at least two digits as an easy way to // check the file isn't empty. c.Check(manifest_text, Matches, `\. .* \d+:\d{2,}:node-info\.txt .*\n`) -- 2.30.2