Fix unit test failing when swift.conf has default policy index >10
Fix unit test failing when swift.conf has default policy index >10

In unit/container/test_backend.py test_policy_stat_tracking in
classes TestContainerBroker[BeforeMetadata|BeforeSPI|BeforeXSync]
fails if the default policy in /etc/swift/swift.conf has an index >10.

Those classes monkey patch the container broker to pre-storage-policy
index behaviour, so that it's policy index will always be 0. The test
fails with a KeyError when asserting that the broker should have stats
for the POLICIES.default index even when no object have been PUT with
that policy index. When the default policy in swift.conf has index
>10, that is neither the broker's policy index (0) nor the policy
index of any other object that has been PUT during the test.

The test need a patch_policies decorator to remove the coupling with
swift.conf policies. However, the assertion that the broker has stats
for it's policy index even when no objects were PUT to that index is
then extremely unlikely to ever be tested, because the broker's
default policy index of 0 is very likely to have used for a PUT
object. So this patch also repeats that assertion before any object
have been PUT

Closes-Bug: #1687029
Change-Id: I8b3678dac83f7329d835059c9973b994bc975a33

clayg/swift,notmyname/swift,swiftstack/swift,notmyname/swift,psachin/swift,tipabu/swift,tipabu/swift,clayg/swift,redbo/swift,tipabu/swift,smerritt/swift,matthewoliver/swift,swiftstack/swift,psachin/swift,nadeemsyed/swift,clayg/swift,nadeemsyed/swift,tipabu/swift,psachin/swift,redbo/swift,notmyname/swift,smerritt/swift,smerritt/swift,swiftstack/swift,openstack/swift,nadeemsyed/swift,notmyname/swift,matthewoliver/swift,matthewoliver/swift,nadeemsyed/swift,psachin/swift,openstack/swift,openstack/swift,smerritt/swift,clayg/swift,matthewoliver/swift,openstack/swift