-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathrender_test.k
28 lines (23 loc) · 943 Bytes
/
render_test.k
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
import file
import yaml
getByCompositeResourceName = lambda name: str -> any {
render = yaml.decode_all(file.read(".cache/render.yaml"))
resource = [ el for el in render if el.metadata.annotations?["crossplane.io/composition-resource-name"] == name][0]
resource
}
test_vnet_name = lambda {
virtualNetwork = getByCompositeResourceName("virtualNetwork")
assert virtualNetwork.metadata.name == "ref-azure-network-from-xr-vnet"
}
test_vnet_address = lambda {
virtualNetwork = getByCompositeResourceName("virtualNetwork")
assert virtualNetwork.spec.forProvider.addressSpace[0] == "192.168.0.0/16"
}
test_vnet_region = lambda {
virtualNetwork = getByCompositeResourceName("virtualNetwork")
assert virtualNetwork.spec.forProvider.location == "westus"
}
test_subnet_svc_endpoints_sql = lambda {
subnet = getByCompositeResourceName("subnet")
assert subnet.spec.forProvider.serviceEndpoints[0] == "Microsoft.Sql"
}