Add unit tests for --template option

Add a few unit tests to verify the default template is selected
correctly if none is specified.

Add mock as a test-time dependency.

Update tox configuration to let user pass arguments to nose, for example
to only run some of the tests.

Change-Id: I231df0051d024393659f5d619f136a0dde1dd1e3