Fix #4361 : pip's requirements option is partially broken in 0.14

Move the conditions to the correct block.
Add a unittest on the requirements option.