Skip to content

Commit

Permalink
add tests
Browse files Browse the repository at this point in the history
  • Loading branch information
lirshindalman committed Oct 22, 2024
1 parent 7ed40bc commit 54629b0
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
5 changes: 3 additions & 2 deletions tests/arm/graph_builder/test_local_graph.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
1 change: 1 addition & 0 deletions tests/arm/randerer/test_rendering.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": [
Expand Down
3 changes: 2 additions & 1 deletion tests/arm/randerer/test_rendering.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down

0 comments on commit 54629b0

Please sign in to comment.