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

Unified Diff: tools/telemetry/telemetry/core/system_info_unittest.py

Issue 739623005: [Telemetry] Resolve errors due to new pylint checker. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: ready to land Created 6 years, 1 month 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/system_info_unittest.py
diff --git a/tools/telemetry/telemetry/core/system_info_unittest.py b/tools/telemetry/telemetry/core/system_info_unittest.py
index e1e876c5103eb38db0fce33bce4e111ddeea9bc5..f064d5f780e980b440ff7e6649a734dd458b87f3 100644
--- a/tools/telemetry/telemetry/core/system_info_unittest.py
+++ b/tools/telemetry/telemetry/core/system_info_unittest.py
@@ -9,15 +9,16 @@ from telemetry.core import system_info
class TestSystemInfo(unittest.TestCase):
+
def testConstruction(self):
data = {
- 'model_name': 'MacBookPro 10.1',
- 'gpu': {
- 'devices': [
- { 'vendor_id': 1000, 'device_id': 2000,
- 'vendor_string': 'a', 'device_string': 'b' },
- ]
- }
+ 'model_name': 'MacBookPro 10.1',
+ 'gpu': {
+ 'devices': [
+ {'vendor_id': 1000, 'device_id': 2000,
+ 'vendor_string': 'a', 'device_string': 'b'},
+ ]
+ }
}
info = system_info.SystemInfo.FromDict(data)
self.assertTrue(isinstance(info, system_info.SystemInfo))
@@ -32,27 +33,27 @@ class TestSystemInfo(unittest.TestCase):
def testEmptyModelName(self):
data = {
- 'model_name': '',
- 'gpu': {
- 'devices': [
- { 'vendor_id': 1000, 'device_id': 2000,
- 'vendor_string': 'a', 'device_string': 'b' },
- ]
- }
+ 'model_name': '',
+ 'gpu': {
+ 'devices': [
+ {'vendor_id': 1000, 'device_id': 2000,
+ 'vendor_string': 'a', 'device_string': 'b'},
+ ]
+ }
}
try:
info = system_info.SystemInfo.FromDict(data)
self.assertEquals(info.model_name, '')
except AssertionError:
raise
- except:
+ except Exception:
self.fail('Should not raise exception for empty model_name string')
def testMissingAttrsFromDict(self):
data = {
- 'model_name': 'MacBookPro 10.1',
- 'devices': [{ 'vendor_id': 1000, 'device_id': 2000,
- 'vendor_string': 'a', 'device_string': 'b' }]
+ 'model_name': 'MacBookPro 10.1',
+ 'devices': [{'vendor_id': 1000, 'device_id': 2000,
+ 'vendor_string': 'a', 'device_string': 'b'}]
}
for k in data:
@@ -63,5 +64,5 @@ class TestSystemInfo(unittest.TestCase):
self.fail('Should raise exception if attribute "%s" is missing' % k)
except AssertionError:
raise
- except:
+ except KeyError:
pass
« no previous file with comments | « tools/telemetry/telemetry/core/platform/win_platform_backend.py ('k') | tools/telemetry/telemetry/core/util.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698