use mock for search

Docker-DCO-1.1-Signed-off-by: Victor Vieux <victor.vieux@docker.com> (github: vieux)
Merge pull request #4647 from vieux/fix_registry_tests

use mock for search