Could someone please let me know if it is possible to test the API (with oauth) from a local machine
I cannot believe that Yahoo restricts access to their API only from the domain toy enter when getting the API key. OK, I understand that for security reasons, it's good, but how on earth are we supposed to develop the thing.
Are you creating an OAuth or an Open application from the dashboard? Unfortunately, as you have already seen, you cannot create an application with a non-public, local URL. If you are creating an OAuth application have you tried making a desktop application instead of a web application? The OAuth flow will not forward you back to the application but you should be able to bypass the URL authentication that way.