mirror of
https://github.com/mcuadros/ascode
synced 2024-11-22 17:02:03 +01:00
starlark/types: Provider.Type
Signed-off-by: Máximo Cuadros <mcuadros@gmail.com>
This commit is contained in:
parent
d25c7b32a2
commit
c8eb85ef8f
@ -84,7 +84,7 @@ func (p *Provider) String() string {
|
||||
|
||||
// Type honors the starlark.Value interface. It shadows p.Resource.Type.
|
||||
func (p *Provider) Type() string {
|
||||
return "provider"
|
||||
return fmt.Sprintf("Provider<%s>", p.name)
|
||||
}
|
||||
|
||||
// Attr honors the starlark.HasAttrs interface.
|
||||
|
1
starlark/types/testdata/provider.star
vendored
1
starlark/types/testdata/provider.star
vendored
@ -8,6 +8,7 @@ assert.eq(len(dir(p.resource)), 506)
|
||||
|
||||
resources = dir(p.resource)
|
||||
assert.contains(resources, "instance")
|
||||
assert.eq(type(p), "Provider<aws>")
|
||||
assert.eq(type(p.resource.instance), "ResourceCollection<resource.aws_instance>")
|
||||
assert.eq(type(p.resource.instance()), "Resource<resource.aws_instance>")
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user