{
  "output": "Successfully created and wrote to new file: /Users/bob/git/dxw/aws-stuff/tests/test_asg.py. Here is the updated code:\nimport unittest\nfrom unittest.mock import MagicMock, patch\nfrom audits.asg import fetch_asg_details\n\nclass TestAsgAudit(unittest.TestCase):\n    @patch(\"audits.asg.get_ami_name\")\n    def test_fetch_asg_details_launch_config(self, mock_get_ami_name):\n        mock_asg_client = MagicMock()\n        mock_ec2_client = MagicMock()\n        mock_get_ami_name.return_value = \"TestAMI\"\n        \n        # Mock ASG with Launch Config\n        mock_asg_client.get_paginator.return_value.paginate.return_value = [\n            {\n                \"AutoScalingGroups\": [\n                    {\n                        \"AutoScalingGroupName\": \"asg-lc\",\n                        \"LaunchConfigurationName\": \"lc-1\"\n                    }\n                ]\n            }\n        ]\n        \n        # Mock LC response\n        mock_asg_client.describe_launch_configurations.return_value = {\n            \"LaunchConfigurations\": [{\"ImageId\": \"ami-123\"}]\n        }\n        \n        results = fetch_asg_details(mock_asg_client, mock_ec2_client, \"123\", \"Acc\", \"region\")\n        \n        self.assertEqual(len(results), 1)\n        self.assertEqual(results[0][\"ASG_Name\"], \"asg-lc\")\n        self.assertEqual(results[0][\"Template_Type\"], \"LaunchConfiguration\")\n        self.assertEqual(results[0][\"AMI_ID\"], \"ami-123\")\n\nif __name__ == \"__main__\":\n    unittest.main()\n"
}