From 54629b0547efc4acc4e590bca5e73be2bbf5dce0 Mon Sep 17 00:00:00 2001 From: lirshindalman Date: Tue, 22 Oct 2024 15:46:54 +0300 Subject: [PATCH] add tests --- tests/arm/graph_builder/test_local_graph.py | 5 +++-- tests/arm/randerer/test_rendering.json | 1 + tests/arm/randerer/test_rendering.py | 3 ++- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/tests/arm/graph_builder/test_local_graph.py b/tests/arm/graph_builder/test_local_graph.py index bae80932eeb..17ef9342efe 100644 --- a/tests/arm/graph_builder/test_local_graph.py +++ b/tests/arm/graph_builder/test_local_graph.py @@ -18,8 +18,9 @@ def test_build_graph(): local_graph.build_graph(render_variables=False) # then - assert len(local_graph.vertices) == 15 - assert len(local_graph.edges) == 0 + assert len(local_graph.vertices) == 18 + assert len(local_graph.edges) == 20 assert len(local_graph.vertices_by_block_type[BlockType.PARAMETER]) == 11 assert len(local_graph.vertices_by_block_type[BlockType.RESOURCE]) == 4 + assert len(local_graph.vertices_by_block_type[BlockType.VARIABLE]) == 3 diff --git a/tests/arm/randerer/test_rendering.json b/tests/arm/randerer/test_rendering.json index 8c6aba3218c..cb7228a2aef 100644 --- a/tests/arm/randerer/test_rendering.json +++ b/tests/arm/randerer/test_rendering.json @@ -35,6 +35,7 @@ "apiVersion": "2020-11-01", "name": "[format('{0}/{1}', parameters('vnetName'), variables('networkProfileName'))]", "location": "[variables('location')]", + "id": "[resourceId('Microsoft.Network/networkProfiles', variables('networkProfileName'))]", "properties": { "addressSpace": { "addressPrefixes": [ diff --git a/tests/arm/randerer/test_rendering.py b/tests/arm/randerer/test_rendering.py index ce4b53e5099..6a7565ac4b2 100644 --- a/tests/arm/randerer/test_rendering.py +++ b/tests/arm/randerer/test_rendering.py @@ -16,8 +16,9 @@ def test_rander_vars(): # then assert len(local_graph.vertices) == 5 - assert len(local_graph.edges) == 4 + assert len(local_graph.edges) == 5 assert local_graph.vertices[2].attributes['name'] == "[format('{0}/{1}', aci-vnet, aci-networkProfile)]" + assert local_graph.vertices[2].attributes['id'] == "[resourceId('Microsoft.Network/networkProfiles', aci-networkProfile)]" assert local_graph.vertices[2].attributes['location'] == "eth0" assert local_graph.vertices[2].attributes['properties.addressSpace.addressPrefixes.0'] == "10.0.0.0/16" assert local_graph.vertices[2].attributes['properties']['addressSpace']['addressPrefixes'][0] == "10.0.0.0/16"