Modify auto_discovery method to suit test.