Increase test coverage of swift/common/db.py
Increase test coverage of swift/common/db.py

The most low hanging fruit is _preallocate(). As it turns out,
we never excercise the calculations because we never give it
a file that exists.

This version uses mock.patch everywhere.

Change-Id: I5df03aff295d2a1bca252a02b3985a6bc3eecb26

revoer/keystone-8.0.0,nadeemsyed/swift,dpgoetz/swift,shibaniahegde/OpenStak_swift,iostackproject/IO-Bandwidth-Differentiation,levythu/swift,mjzmjz/swift,psachin/swift,JioCloud/swift,notmyname/swift,levythu/swift,sarvesh-ranjan/swift,tipabu/swift,takeshineshiro/swift,maginatics/swift,scality/ScalitySproxydSwift,redbo/swift,prashanthpai/swift,hurricanerix/swift,rackerlabs/swift,citrix-openstack/build-swift,psachin/swift,hurricanerix/swift,hurricanerix/swift,matthewoliver/swift,hbhdytf/mac,IPVL/swift-kilo,anishnarang/gswift,mjzmjz/swift,matthewoliver/swift,aerwin3/swift,nadeemsyed/swift,redbo/swift,clayg/swift,larsbutler/swift,clayg/swift,citrix-openstack-build/swift,dpgoetz/swift,hbhdytf/mac2,nadeemsyed/swift,dencaval/swift,iostackproject/IO-Bandwidth-Differentiation,bkolli/swift,mjwtom/swift,tsli/test,bouncestorage/swift,smerritt/swift,zackmdavis/swift,thiagodasilva/swift,sarvesh-ranjan/swift,anishnarang/gswift,Em-Pan/swift,shibaniahegde/OpenStak_swift,nadeemsyed/swift,williamthegrey/swift,hbhdytf/mac,mjwtom/swift,Seagate/swift,Khushbu27/Tutorial,maginatics/swift,clayg/swift,clayg/swift,prashanthpai/swift,Em-Pan/swift,gold3bear/swift,revoer/keystone-8.0.0,hbhdytf/mac2,redhat-openstack/swift,openstack/swift,larsbutler/swift,Seagate/swift,hbhdytf/mac2,xiaoguoai/ec-dev-swift,zackmdavis/swift,tipabu/swift,eatbyte/Swift,citrix-openstack/build-swift,Akanoa/swift,dencaval/swift,notmyname/swift,openstack/swift,Akanoa/swift,swiftstack/swift,JioCloud/swift,tipabu/swift,tipabu/swift,smerritt/swift,swiftstack/swift,Khushbu27/Tutorial,redhat-openstack/swift,rackerlabs/swift,bradleypj823/swift,notmyname/swift,bkolli/swift,notmyname/swift,psachin/swift,AfonsoFGarcia/swift,openstack/swift,NeCTAR-RC/swift,scality/ScalitySproxydSwift,bouncestorage/swift,bradleypj823/swift,psachin/swift,eatbyte/Swift,xiaoguoai/ec-dev-swift,daasbank/swift,openstack/swift,aerwin3/swift,AfonsoFGarcia/swift,thiagodasilva/swift,gold3bear/swift,takeshineshiro/swift,smerritt/swift,wenhuizhang/swift,matthewoliver/swift,IPVL/swift-kilo,swiftstack/swift,wenhuizhang/swift,hurricanerix/swift,NeCTAR-RC/swift,hbhdytf/mac2,tsli/test,matthewoliver/swift,williamthegrey/swift,daasbank/swift,smerritt/swift,citrix-openstack-build/swift