trivial: fix flakey account/test_auditor.py assertion

The test assertion assumes the test environment has exactly one
policy, but the test setup uses whatever number of policies are
currently in POLICIES. This can cause the test to fail in environments
where more than one policy is configured.

Fix the assertion to also use the actual number of policies.

Change-Id: I8fecc583f211913144663c85ab27ad448b5600f8
This commit is contained in:
Alistair Coles 2022-11-30 10:55:17 +00:00
parent a1939cba03
commit 662ef28083
1 changed files with 3 additions and 2 deletions

View File

@ -126,8 +126,9 @@ class TestAuditorRealBroker(unittest.TestCase):
error_message = error_lines[0]
self.assertIn(broker.db_file, error_message)
self.assertIn(
'The total container_count for the account a (3) does not match '
'the sum of container_count across policies (2)', error_message)
'The total container_count for the account a (%d) does not match '
'the sum of container_count across policies (%d)'
% (num_containers, num_containers - 1), error_message)
self.assertEqual(test_auditor.logger.get_increment_counts(),
{'failures': 1})