{
  "output": "Successfully created and wrote to new file: /Users/bob/git/dxw/aws-stuff/tests/test_cost.py. Here is the updated code:\nimport unittest\nfrom unittest.mock import MagicMock\nfrom audits.cost import fetch_costs_with_savings\n\nclass TestCostAudit(unittest.TestCase):\n    def test_fetch_costs_with_savings(self):\n        mock_ce = MagicMock()\n        \n        # Mock response\n        mock_ce.get_cost_and_usage.return_value = {\n            \"ResultsByTime\": [\n                {\n                    \"TimePeriod\": {\"Start\": \"2023-10-01\", \"End\": \"2023-11-01\"},\n                    \"Groups\": [\n                        {\n                            \"Keys\": [\"123456789012\", \"Amazon Elastic Compute Cloud - Compute\"],\n                            \"Metrics\": {\n                                \"UnblendedCost\": {\"Amount\": \"100.0\", \"Unit\": \"USD\"},\n                                \"AmortizedCost\": {\"Amount\": \"90.0\", \"Unit\": \"USD\"},\n                                \"NetAmortizedCost\": {\"Amount\": \"85.0\", \"Unit\": \"USD\"},\n                                \"NetUnblendedCost\": {\"Amount\": \"95.0\", \"Unit\": \"USD\"},\n                            }\n                        }\n                    ]\n                }\n            ]\n        }\n        \n        account_map = {\"123456789012\": \"Test Account\"}\n        \n        results = fetch_costs_with_savings(mock_ce, \"2023-10-01\", \"2023-11-01\", account_map)\n        \n        self.assertEqual(len(results), 1)\n        self.assertEqual(results[0][\"AccountName\"], \"Test Account\")\n        self.assertEqual(results[0][\"Service\"], \"Amazon Elastic Compute Cloud - Compute\")\n        self.assertEqual(results[0][\"UnblendedCost\"], 100.0)\n        self.assertEqual(results[0][\"AmortizedCost\"], 90.0)\n\nif __name__ == \"__main__\":\n    unittest.main()\n"
}