Beispiel #1
0
 def test_crawl_account_hierarchy_with_provider_uuid(self, mock_crawler):
     """Test that only accounts associated with the provider_uuid are polled."""
     mock_crawler.crawl_account_hierarchy.return_value = True
     with self.assertLogs("masu.celery.tasks", "INFO") as captured_logs:
         tasks.crawl_account_hierarchy(self.aws_test_provider_uuid)
         expected_log_msg = "Account hierarchy crawler found %s accounts to scan" % ("1")
         self.assertIn(expected_log_msg, captured_logs.output[0])
Beispiel #2
0
 def test_crawl_account_hierarchy_without_provider_uuid(self, mock_crawler):
     """Test that all polling accounts for user are used when no provider_uuid is provided."""
     _, polling_accounts = Orchestrator.get_accounts()
     mock_crawler.crawl_account_hierarchy.return_value = True
     with self.assertLogs("masu.celery.tasks", "INFO") as captured_logs:
         tasks.crawl_account_hierarchy()
         expected_log_msg = "Account hierarchy crawler found %s accounts to scan" % (len(polling_accounts))
         self.assertIn(expected_log_msg, captured_logs.output[0])