Skip to content

Commit

Permalink
Unit tests for new assets
Browse files Browse the repository at this point in the history
  • Loading branch information
pritchyspritch committed May 21, 2024
1 parent 3e2b624 commit 7cc3116
Showing 1 changed file with 41 additions and 0 deletions.
41 changes: 41 additions & 0 deletions tests/test_build_tech_assets.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
build_cache_tm,
build_app_service_tm,
build_storage_tm,
build_db_tm,
build_vm_tm,
)


Expand Down Expand Up @@ -135,6 +137,45 @@ def test_build_app_service_tm(self):
)
)

def test_build_db_tm(self):
name = "test_build_db_name"
asset_type = "test_build_db_asset_type/test"
build_db_asset_yaml, tag_list = build_db_tm(name, asset_type)

expected_tag_list = [
"test_build_db_name",
"azure",
"azure-sql",
"sql",
"microsoft-sql",
"database",
"test_build_db_asset_type/test",
]

self.assertTrue(lists_are_equal(expected_tag_list, tag_list))
self.assertTrue(
yaml_contains_correct_values(build_db_asset_yaml, name, asset_type)
)

def test_build_vm_tm(self):
name = "test_build_vm_name"
asset_type = "test_build_vm_asset_type/test"
build_vm_asset_yaml, tag_list = build_vm_tm(name, asset_type)

expected_tag_list = [
"test_build_vm_name",
"azure",
"azure-virtual-machine",
"virtual-machine",
"vm",
"test_build_vm_asset_type/test",
]

self.assertTrue(lists_are_equal(expected_tag_list, tag_list))
self.assertTrue(
yaml_contains_correct_values(build_vm_asset_yaml, name, asset_type)
)


if __name__ == "__main__":
unittest.main()

0 comments on commit 7cc3116

Please sign in to comment.