Hi Jacek,
So, unit-testing a piece of software that relies on environment behaviour is a hard thing, and using virtual machines is not an efficient way to do unit-testing. For these reasons we rely a lot on mocks and on our knowledge of the underlying system behaviour. Sometimes what I do is test a certain low-level behaviour, say, the interaction between Fabric and a remote server (using Vagrant, for example), learn what's the result of this interaction and build a test double (mock, stub etc) for this, since I already know how it behaves in this situation.
So for the time being that's what we have available to do unit-testing. Also keep in mind that we use Travis CI as our CI system, which doesn't allow any kind of virtual machine instantiation.
I hope this helps you somehow.
Cheers,
Diogo