Skip to content

Commit 3804a6d

Browse files
test: Add more checks to registry tests.
1 parent ba5be7b commit 3804a6d

File tree

1 file changed

+30
-0
lines changed

1 file changed

+30
-0
lines changed

registry_module_integration_test.go

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1373,7 +1373,22 @@ func TestRegistryModulesReadTerraformRegistryModule(t *testing.T) {
13731373
r.NoError(err)
13741374
r.NotNil(tfm)
13751375
r.Equal(fmt.Sprintf("%s/%s/%s/%s", orgTest.Name, rm.Name, rm.Provider, version), tfm.ID)
1376+
r.Equal(rm.Name, tfm.Name)
1377+
r.Equal("A test Terraform module for use in CI pipelines", tfm.Description)
1378+
r.Equal(rm.Provider, tfm.Provider)
1379+
r.Equal(rm.Namespace, tfm.Namespace)
13761380
r.Equal(version, tfm.Version)
1381+
r.Equal("", tfm.Tag)
1382+
r.Equal(0, tfm.Downloads)
1383+
r.False(tfm.Verified)
1384+
r.NotNil(tfm.Root)
1385+
r.Equal(rm.Name, tfm.Root.Name)
1386+
r.Equal("", tfm.Root.Readme)
1387+
r.False(tfm.Root.Empty)
1388+
r.Len(tfm.Root.Inputs, 1)
1389+
r.Len(tfm.Root.Outputs, 1)
1390+
r.Len(tfm.Root.ProviderDependencies, 1)
1391+
r.Len(tfm.Root.Resources, 1)
13771392
})
13781393

13791394
t.Run("fetch module from public registry", func(t *testing.T) {
@@ -1410,7 +1425,22 @@ func TestRegistryModulesReadTerraformRegistryModule(t *testing.T) {
14101425
r.NoError(err)
14111426
r.NotNil(tfm)
14121427
r.Equal(fmt.Sprintf("%s/%s/%s/%s", orgTest.Name, rm.Name, rm.Provider, version), tfm.ID)
1428+
r.Equal(rm.Name, tfm.Name)
1429+
r.Equal("A test Terraform module for use in CI pipelines", tfm.Description)
1430+
r.Equal(rm.Provider, tfm.Provider)
1431+
r.Equal(rm.Namespace, tfm.Namespace)
14131432
r.Equal(version, tfm.Version)
1433+
r.Equal("", tfm.Tag)
1434+
r.Equal(0, tfm.Downloads)
1435+
r.False(tfm.Verified)
1436+
r.NotNil(tfm.Root)
1437+
r.Equal(rm.Name, tfm.Root.Name)
1438+
r.Equal("", tfm.Root.Readme)
1439+
r.False(tfm.Root.Empty)
1440+
r.Len(tfm.Root.Inputs, 1)
1441+
r.Len(tfm.Root.Outputs, 1)
1442+
r.Len(tfm.Root.ProviderDependencies, 1)
1443+
r.Len(tfm.Root.Resources, 1)
14141444
})
14151445
}
14161446

0 commit comments

Comments
 (0)