test_azure_1.py 1.1 KB

12345678910111213141516171819202122232425262728293031323334
  1. def azure_layer() -> Mock:
  2. layer = Mock(spec=Layer)
  3. layer.parent = None
  4. layer.cloud = "azurerm"
  5. layer.name = "blah"
  6. layer.providers = {
  7. "azurerm": {
  8. "location": "centralus",
  9. "tenant_id": "blahbc17-blah-blah-blah-blah291d395b",
  10. "subscription_id": "blah99ae-blah-blah-blah-blahd2a04788",
  11. }
  12. }
  13. layer.root.return_value = layer
  14. layer.gen_providers.return_value = {
  15. "terraform": {
  16. "backend": {
  17. "azurerm": {
  18. "resource_group_name": "dummy_resource_group",
  19. "storage_account_name": "dummy_storage_account",
  20. "container_name": "dummy_container_name",
  21. "key": "dummy_key",
  22. }
  23. }
  24. },
  25. "provider": {
  26. "azurerm": {
  27. "location": "centralus",
  28. "tenant_id": "blahbc17-blah-blah-blah-blah291d395b",
  29. "subscription_id": "blah99ae-blah-blah-blah-blahd2a04788",
  30. }
  31. },
  32. }
  33. layer.get_cluster_name.return_value = "mocked_cluster_name"
  34. return layer