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 file and merge them
into the existing unittest module.

TEST=`./` passes

Change-Id: I64e1407884e9f25efc8a18b30c46fd0a9defbb6a
Reviewed-by: Nam Nguyen <>
Tested-by: Mike Frysinger <>
2 files changed