Initial commit of mock 2.0.0 Added in: - METADATA - Android.bp - NOTICE - MODULE_LICENSE_BSD Modified mock.py to not depend on pbr module, pbr was just used for versioning and since mock has not been modified in months (last commit was Jan 2018) I just hardcoded the version into mock.py instead. Merge commit '8c19ef6c95004524cb9f0b170a1aff6f47ade764' into import Bug: 112163440 Test: Built acloud-test with py-mock and was able to run successfully Change-Id: Iec384477c863178730f6e42cf67044eb80ec0ce1
diff --git a/METADATA b/METADATA new file mode 100644 index 0000000..e0d0615 --- /dev/null +++ b/METADATA
@@ -0,0 +1,19 @@ +name: "mock" +description: + "mock is a library for testing in Python. It allows you to replace parts of " + "your system under test with mock objects and make assertions about how " + "they have been used." + +third_party { + url { + type: HOMEPAGE + value: "https://pypi.org/project/mock/" + } + url { + type: GIT + value: "https://github.com/testing-cabal/mock" + } + version: "2.0.0" + last_upgrade_date { year: 2018 month: 8 day: 1 } + license_type: NOTICE +}
diff --git a/MODULE_LICENSE_BSD b/MODULE_LICENSE_BSD new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/MODULE_LICENSE_BSD
diff --git a/NOTICE b/NOTICE new file mode 120000 index 0000000..85de3d4 --- /dev/null +++ b/NOTICE
@@ -0,0 +1 @@ +LICENSE.txt \ No newline at end of file
diff --git a/mock/Android.bp b/mock/Android.bp new file mode 100644 index 0000000..fad055b --- /dev/null +++ b/mock/Android.bp
@@ -0,0 +1,34 @@ +// Copyright 2018 Google Inc. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +python_library { + name: "py-mock", + host_supported: true, + srcs: [ + "*.py", + ], + version: { + py2: { + enabled: true, + }, + py3: { + enabled: true, + }, + }, + libs: [ + "py-funcsigs", + "py-six", + ], + pkg_path: "mock", +}
diff --git a/mock/mock.py b/mock/mock.py index 7e4bb76..beedd69 100644 --- a/mock/mock.py +++ b/mock/mock.py
@@ -66,11 +66,17 @@ import six from six import wraps -from pbr.version import VersionInfo +# GOOGLE +# We're going to avoid using pbr so we don't have to import it into AOSP just +# for the version info, instead we'll hardcode it. This will be safe since mock +# dev is essentially stable and hasn't been changed in months. +# from pbr.version import VersionInfo -_v = VersionInfo('mock').semantic_version() -__version__ = _v.release_string() -version_info = _v.version_tuple() +# _v = VersionInfo('mock').semantic_version() +# __version__ = _v.release_string() +# version_info = _v.version_tuple() +__version__ = '2.0.0' +version_info = (2, 0, 0, 'final', 0) import mock