unittests: cut over to the new wrapper
Now that we have a wrapper to deal with the namespace munging, we can
clean up all our unittests. This means:
- add a wrapper symlink for all the unittests
- drop the +x bits on the direct .py file
- drop the shebang on the direct .py file
- delete the manual sys.path munging
- move the mock import to the common system import path
- delete unused os/sys imports
- delete most manual calls to cros_test_lib.main
- add a main() for the few complicated cros_test_lib.main calls
BUG=chromium:219660
TEST=ran all the unittests
Change-Id: I85614c301e48c86a0ca4201c2b60349d2d488e52
Reviewed-on: https://chromium-review.googlesource.com/233832
Reviewed-by: David James <davidjames@chromium.org>
Reviewed-by: Don Garrett <dgarrett@chromium.org>
Tested-by: Mike Frysinger <vapier@chromium.org>
Commit-Queue: Mike Frysinger <vapier@chromium.org>
diff --git a/scripts/upload_prebuilts_unittest.py b/scripts/upload_prebuilts_unittest.py
old mode 100755
new mode 100644
index 30dad88..58f5304
--- a/scripts/upload_prebuilts_unittest.py
+++ b/scripts/upload_prebuilts_unittest.py
@@ -1,4 +1,3 @@
-#!/usr/bin/python
# Copyright (c) 2012 The Chromium OS Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
@@ -8,14 +7,12 @@
from __future__ import print_function
import copy
+import mock
import mox
import os
import multiprocessing
-import sys
import tempfile
-sys.path.insert(0, os.path.join(os.path.dirname(os.path.realpath(__file__)),
- '..', '..'))
from chromite.scripts import upload_prebuilts as prebuilt
from chromite.lib import cros_test_lib
from chromite.lib import gs
@@ -23,8 +20,6 @@
from chromite.lib import osutils
from chromite.lib import portage_util
-import mock
-
# pylint: disable=E1120,W0212,R0904
PUBLIC_PACKAGES = [{'CPV': 'gtk+/public1', 'SHA1': '1', 'MTIME': '1'},
@@ -526,7 +521,3 @@
)
tc_upload_path = '1994/04/%(target)s-1994.04.02.tar.xz'
self.testSdkUpload(tc_tarballs, tc_upload_path)
-
-
-if __name__ == '__main__':
- cros_test_lib.main()