Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(188)

Unified Diff: tools/telemetry/telemetry/core/platform/linux_platform_backend_unittest.py

Issue 660893002: [Telemetry] Implement automatic installation of optional openCV dependecy. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: nits Created 6 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: tools/telemetry/telemetry/core/platform/linux_platform_backend_unittest.py
diff --git a/tools/telemetry/telemetry/core/platform/linux_platform_backend_unittest.py b/tools/telemetry/telemetry/core/platform/linux_platform_backend_unittest.py
index bc7465f7d1854ffca59bcf6e6473397f65d4921c..12e59b5d14be09be96cca3c3a8d6d900c164f5e2 100644
--- a/tools/telemetry/telemetry/core/platform/linux_platform_backend_unittest.py
+++ b/tools/telemetry/telemetry/core/platform/linux_platform_backend_unittest.py
@@ -6,6 +6,7 @@ import os
import unittest
from telemetry import decorators
+from telemetry.core import platform
from telemetry.core import util
from telemetry.core.platform import linux_platform_backend
@@ -70,3 +71,15 @@ class LinuxPlatformBackendTest(unittest.TestCase):
# a distribution may not have a codename or a release number. We just check
# that GetOSVersionName doesn't raise an exception
backend.GetOSVersionName()
+
+ @decorators.Enabled('linux')
+ def testOpenCVDependency(self):
+ try:
+ import cv2
+ if (cv2.__version__ != '2.4.10'):
+ raise ImportError()
+ except ImportError:
+ platform.GetHostPlatform().InstallPythonModule('cv2')
+ import cv2
+ self.assertEqual('2.4.10', cv2.__version__, 'Wrong OpenCV version found. '
+ 'Expected 2.4.10, but newer versions may be okay.')

Powered by Google App Engine
This is Rietveld 408576698