Skip to content
This repository was archived by the owner on Jun 11, 2021. It is now read-only.

Commit 4d8a0ae

Browse files
committed
More refactoring of registry related code, add simple test
1 parent e9511e9 commit 4d8a0ae

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

pkg/xterrafile/registry.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,11 +50,11 @@ func GetRegistrySource(name string, source string, version string, services *dis
5050

5151
version, err = getRegistryVersion(regClient, modSrc, version)
5252
CheckIfError(name, err)
53-
5453
jww.INFO.Printf("[%s] Found module version %s at %s", name, version, modSrc.Host())
5554

5655
regSrc, err := regClient.ModuleLocation(modSrc, version)
5756
CheckIfError(name, err)
57+
jww.INFO.Printf("[%s] Downloading from source URL %s", name, regSrc)
5858

5959
return regSrc
6060
}

pkg/xterrafile/registry_test.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,11 @@ func TestIsRegistrySourceAddr(t *testing.T) {
2323
}
2424

2525
func TestGetRegistrySource(t *testing.T) {
26+
server := test.Registry()
27+
defer server.Close()
2628

29+
module1Src := GetRegistrySource("droplet", "example.com/test-versions/name/provider", "2.1.x", test.Disco(server))
30+
assert.IsType(t, "string", module1Src, "download URL should be a string")
2731
}
2832

2933
func TestGetModSrc(t *testing.T) {

0 commit comments

Comments
 (0)