Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mapsme/omim.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorIlya Zverev <ilya@zverev.info>2016-08-15 16:20:18 +0300
committerGitHub <noreply@github.com>2016-08-15 16:20:18 +0300
commitfd3b5bddc366f1b8ba7b100eb89b5254481e4c40 (patch)
tree9eae7ecbe060a00db026f0a2b5aab98b5c6368dc /tools
parentd6adfca9238835a39b722407bf31ee8ec0e9e19f (diff)
parent9b7b9fcd3c44a7732d60d5f9d4a369c41df84c6f (diff)
Merge pull request #4043 from therearesomewhocallmetim/py_perm_fix_3
Build type fix.
Diffstat (limited to 'tools')
-rwxr-xr-xtools/python_tests/permissions_test.py25
1 files changed, 18 insertions, 7 deletions
diff --git a/tools/python_tests/permissions_test.py b/tools/python_tests/permissions_test.py
index 17138859e0..3372a59cd3 100755
--- a/tools/python_tests/permissions_test.py
+++ b/tools/python_tests/permissions_test.py
@@ -19,18 +19,20 @@ EXPECTED_PERMISSIONS = {
"uses-permission: android.permission.WAKE_LOCK",
"uses-permission: android.permission.GET_ACCOUNTS",
"uses-permission: com.google.android.c2dm.permission.RECEIVE",
- "permission: com.mapswithme.maps.pro.beta.permission.C2D_MESSAGE",
- "uses-permission: com.mapswithme.maps.pro.beta.permission.C2D_MESSAGE",
+ "permission: com.mapswithme.maps.pro.permission.C2D_MESSAGE",
+ "uses-permission: com.mapswithme.maps.pro.permission.C2D_MESSAGE",
"uses-permission: android.permission.VIBRATE",
- "permission: com.mapswithme.maps.pro.beta.permission.RECEIVE_ADM_MESSAGE",
- "uses-permission: com.mapswithme.maps.pro.beta.permission.RECEIVE_ADM_MESSAGE",
+ "permission: com.mapswithme.maps.pro.permission.RECEIVE_ADM_MESSAGE",
+ "uses-permission: com.mapswithme.maps.pro.permission.RECEIVE_ADM_MESSAGE",
"uses-permission: com.amazon.device.messaging.permission.RECEIVE",
}
SPLIT_RE = re.compile("[\.\-]")
APK_RE = re.compile(".*universal(?!.*?unaligned).*$")
PROP_RE = re.compile("(?!\s*?#).*$")
-CLEAN_PERM_RE = re.compile("(name='|'$)", re.MULTILINE)
+CLEAN_PERM_RE = re.compile("(name='|'$|debug\.|beta\.)", re.MULTILINE)
+BUILD_TYPE = r = re.compile(".*(debug|release|beta).*")
+
AAPT_VERSION_PREFIX_LEN = len("Android Asset Packaging Tool, v")
@@ -59,8 +61,17 @@ class TestPermissions(unittest.TestCase):
self.aapt = self.find_aapt(self.get_build_tools_version())
self.apk = self.find_apks()
self.permissions = self.get_actual_permissions()
+ if self.get_build_type() == "debug":
+ logging.info("The build type is DEBUG")
+ global EXPECTED_PERMISSIONS
+ EXPECTED_PERMISSIONS.add("uses-permission: android.permission.READ_LOGS")
+
self.failure_description = self.get_failure_description()
+ def get_build_type(self):
+ apk_name = path.basename(self.apk)
+ return BUILD_TYPE.findall(apk_name)[0]
+
def get_build_tools_version(self):
return self.get_property(
@@ -157,9 +168,9 @@ class TestPermissions(unittest.TestCase):
def get_failure_description(self):
- join_by_new_lines = lambda iterable: "\n".join(iterable)
+ join_by_new_lines = lambda iterable: "\n".join(sorted(iterable))
- return "Expected: {}\n\nActual: {}\n\nAdded: {}\n\nRemoved: {}".format(
+ return "Expected:\n{}\n\nActual:\n{}\n\nAdded:\n{}\n\nRemoved:\n{}".format(
join_by_new_lines(EXPECTED_PERMISSIONS),
join_by_new_lines(self.permissions),
join_by_new_lines(self.permissions - EXPECTED_PERMISSIONS),