pre-upload: rework main and its tests

The current main func tries to uses doctest module for verifying its
behavior.  The trouble is that we don't use this module elsewhere in
CrOS, so no one ever notices it.  The tests contained therein have
also rotted a bit and don't pass.

Rip the --test support out of the pre-upload.py file and merge them
into the existing unittest module.

BUG=None
TEST=`./pre-upload_unittest.py` passes

Change-Id: I64e1407884e9f25efc8a18b30c46fd0a9defbb6a
Reviewed-on: https://chromium-review.googlesource.com/236640
Reviewed-by: Nam Nguyen <namnguyen@chromium.org>
Tested-by: Mike Frysinger <vapier@chromium.org>
2 files changed