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

Unified Diff: third_party/WebKit/Tools/Scripts/webkitpy/layout_tests/models/test_configuration_unittest.py

Issue 1783073002: Run auto-formatter on files in webkitpy/layout_tests/. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Ran yapf -i --style '{based_on_style: pep8, column_limit: 132}' then did manual fix-up Created 4 years, 9 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: third_party/WebKit/Tools/Scripts/webkitpy/layout_tests/models/test_configuration_unittest.py
diff --git a/third_party/WebKit/Tools/Scripts/webkitpy/layout_tests/models/test_configuration_unittest.py b/third_party/WebKit/Tools/Scripts/webkitpy/layout_tests/models/test_configuration_unittest.py
index d5c47ae96a72776b72e84f6307463c4e2e5ae113..56e87b9e7bd7d8023dde1afd1ebc8e3ed66f43fb 100644
--- a/third_party/WebKit/Tools/Scripts/webkitpy/layout_tests/models/test_configuration_unittest.py
+++ b/third_party/WebKit/Tools/Scripts/webkitpy/layout_tests/models/test_configuration_unittest.py
@@ -33,21 +33,14 @@ from webkitpy.layout_tests.models.test_configuration import *
def make_mock_all_test_configurations_set():
all_test_configurations = set()
- for version, architecture in (('snowleopard', 'x86'),
- ('win7', 'x86'),
- ('vista', 'x86'),
- ('linux32', 'x86'),
- ('precise', 'x86_64'),
- ('trusty', 'x86_64')):
+ for version, architecture in (('snowleopard', 'x86'), ('win7', 'x86'), ('vista', 'x86'), ('linux32', 'x86'),
+ ('precise', 'x86_64'), ('trusty', 'x86_64')):
for build_type in ('debug', 'release'):
all_test_configurations.add(TestConfiguration(version, architecture, build_type))
return all_test_configurations
-MOCK_MACROS = {
- 'mac': ['snowleopard'],
- 'win': ['vista', 'win7'],
- 'linux': ['linux32', 'precise', 'trusty'],
-}
+
+MOCK_MACROS = {'mac': ['snowleopard'], 'win': ['vista', 'win7'], 'linux': ['linux32', 'precise', 'trusty'], }
qyearsley 2016/03/18 00:33:39 Sometimes yapf reformats literal dicts and lists s
Dirk Pranke 2016/03/19 02:19:56 Yup, it's clearly trying to fit more stuff on a si
class TestConfigurationTest(unittest.TestCase):
@@ -85,7 +78,8 @@ class TestConfigurationTest(unittest.TestCase):
self.assertRaises(KeyError, query_unknown_key)
self.assertIn(TestConfiguration('win7', 'x86', 'release'), config_dict)
self.assertNotIn(TestConfiguration('win7', 'x86', 'debug'), config_dict)
- configs_list = [TestConfiguration('win7', 'x86', 'release'), TestConfiguration('win7', 'x86', 'debug'), TestConfiguration('win7', 'x86', 'debug')]
+ configs_list = [TestConfiguration('win7', 'x86', 'release'), TestConfiguration('win7', 'x86', 'debug'),
+ TestConfiguration('win7', 'x86', 'debug')]
self.assertEqual(len(configs_list), 3)
self.assertEqual(len(set(configs_list)), 2)
@@ -148,7 +142,10 @@ class SpecifierSorterTest(unittest.TestCase):
self.assertEqual(sorter.sort_specifiers(set(['x86'])), ['x86'])
self.assertEqual(sorter.sort_specifiers(set(['x86', 'win7'])), ['win7', 'x86'])
self.assertEqual(sorter.sort_specifiers(set(['x86', 'debug', 'win7'])), ['win7', 'x86', 'debug'])
- self.assertEqual(sorter.sort_specifiers(set(['snowleopard', 'x86', 'debug', 'win7'])), ['snowleopard', 'win7', 'x86', 'debug'])
+ self.assertEqual(
+ sorter.sort_specifiers(set(['snowleopard', 'x86', 'debug', 'win7'])), [
+ 'snowleopard', 'win7', 'x86', 'debug'
+ ])
self.assertEqual(sorter.sort_specifiers(set(['x86', 'mac', 'debug', 'win7'])), ['mac', 'win7', 'x86', 'debug'])
@@ -159,7 +156,9 @@ class TestConfigurationConverterTest(unittest.TestCase):
def test_symmetric_difference(self):
self.assertEqual(TestConfigurationConverter.symmetric_difference([set(['a', 'b']), set(['b', 'c'])]), set(['a', 'c']))
- self.assertEqual(TestConfigurationConverter.symmetric_difference([set(['a', 'b']), set(['b', 'c']), set(['b', 'd'])]), set(['a', 'c', 'd']))
+ self.assertEqual(
+ TestConfigurationConverter.symmetric_difference([set(['a', 'b']), set(['b', 'c']), set(['b', 'd'])]),
+ set(['a', 'c', 'd']))
def test_to_config_set(self):
converter = TestConfigurationConverter(self._all_test_configurations)
@@ -176,9 +175,7 @@ class TestConfigurationConverterTest(unittest.TestCase):
self.assertEqual(converter.to_config_set(set(['win7', 'x86_64'])), set())
- configs_to_match = set([
- TestConfiguration('win7', 'x86', 'release'),
- ])
+ configs_to_match = set([TestConfiguration('win7', 'x86', 'release'), ])
self.assertEqual(converter.to_config_set(set(['win7', 'release'])), configs_to_match)
configs_to_match = set([
@@ -207,8 +204,7 @@ class TestConfigurationConverterTest(unittest.TestCase):
TestConfiguration('snowleopard', 'x86', 'release'),
TestConfiguration('snowleopard', 'x86', 'debug'),
])
- self.assertEqual(converter.to_config_set(set(['trusty', 'precise', 'snowleopard'])),
- configs_to_match)
+ self.assertEqual(converter.to_config_set(set(['trusty', 'precise', 'snowleopard'])), configs_to_match)
configs_to_match = set([
TestConfiguration('linux32', 'x86', 'release'),
@@ -216,25 +212,19 @@ class TestConfigurationConverterTest(unittest.TestCase):
TestConfiguration('snowleopard', 'x86', 'release'),
TestConfiguration('snowleopard', 'x86', 'debug'),
])
- self.assertEqual(converter.to_config_set(set(['linux32', 'snowleopard', 'x86'])),
- configs_to_match)
+ self.assertEqual(converter.to_config_set(set(['linux32', 'snowleopard', 'x86'])), configs_to_match)
configs_to_match = set([
TestConfiguration('trusty', 'x86_64', 'release'),
TestConfiguration('linux32', 'x86', 'release'),
TestConfiguration('snowleopard', 'x86', 'release'),
])
- self.assertEqual(
- converter.to_config_set(set(['trusty', 'linux32', 'snowleopard', 'release'])),
- configs_to_match)
+ self.assertEqual(converter.to_config_set(set(['trusty', 'linux32', 'snowleopard', 'release'])), configs_to_match)
def test_macro_expansion(self):
converter = TestConfigurationConverter(self._all_test_configurations, MOCK_MACROS)
- configs_to_match = set([
- TestConfiguration('vista', 'x86', 'release'),
- TestConfiguration('win7', 'x86', 'release'),
- ])
+ configs_to_match = set([TestConfiguration('vista', 'x86', 'release'), TestConfiguration('win7', 'x86', 'release'), ])
self.assertEqual(converter.to_config_set(set(['win', 'release'])), configs_to_match)
configs_to_match = set([
@@ -243,8 +233,7 @@ class TestConfigurationConverterTest(unittest.TestCase):
TestConfiguration('linux32', 'x86', 'release'),
TestConfiguration('trusty', 'x86_64', 'release'),
])
- self.assertEqual(converter.to_config_set(set(['win', 'linux32', 'trusty', 'release'])),
- configs_to_match)
+ self.assertEqual(converter.to_config_set(set(['win', 'linux32', 'trusty', 'release'])), configs_to_match)
configs_to_match = set([
TestConfiguration('vista', 'x86', 'release'),
@@ -259,15 +248,10 @@ class TestConfigurationConverterTest(unittest.TestCase):
self.assertEqual(converter.to_specifiers_list(set(self._all_test_configurations)), [[]])
self.assertEqual(converter.to_specifiers_list(set()), [])
- configs_to_match = set([
- TestConfiguration('win7', 'x86', 'release'),
- ])
+ configs_to_match = set([TestConfiguration('win7', 'x86', 'release'), ])
self.assertEqual(converter.to_specifiers_list(configs_to_match), [set(['release', 'win7'])])
- configs_to_match = set([
- TestConfiguration('win7', 'x86', 'release'),
- TestConfiguration('win7', 'x86', 'debug'),
- ])
+ configs_to_match = set([TestConfiguration('win7', 'x86', 'release'), TestConfiguration('win7', 'x86', 'debug'), ])
self.assertEqual(converter.to_specifiers_list(configs_to_match), [set(['win7'])])
configs_to_match = set([
@@ -276,8 +260,7 @@ class TestConfigurationConverterTest(unittest.TestCase):
TestConfiguration('trusty', 'x86_64', 'debug'),
TestConfiguration('win7', 'x86', 'release'),
])
- self.assertEqual(converter.to_specifiers_list(configs_to_match),
- [set(['release', 'win7']), set(['debug', 'linux'])])
+ self.assertEqual(converter.to_specifiers_list(configs_to_match), [set(['release', 'win7']), set(['debug', 'linux'])])
configs_to_match = set([
TestConfiguration('win7', 'x86', 'release'),
@@ -289,8 +272,7 @@ class TestConfigurationConverterTest(unittest.TestCase):
TestConfiguration('precise', 'x86_64', 'debug'),
TestConfiguration('linux32', 'x86', 'debug'),
])
- self.assertEqual(converter.to_specifiers_list(configs_to_match),
- [set(['release', 'win7']), set(['debug', 'linux'])])
+ self.assertEqual(converter.to_specifiers_list(configs_to_match), [set(['release', 'win7']), set(['debug', 'linux'])])
configs_to_match = set([
TestConfiguration('win7', 'x86', 'release'),
@@ -302,10 +284,7 @@ class TestConfigurationConverterTest(unittest.TestCase):
])
self.assertEqual(converter.to_specifiers_list(configs_to_match), [set(['release'])])
- configs_to_match = set([
- TestConfiguration('win7', 'x86', 'release'),
- TestConfiguration('snowleopard', 'x86', 'release'),
- ])
+ configs_to_match = set([TestConfiguration('win7', 'x86', 'release'), TestConfiguration('snowleopard', 'x86', 'release'), ])
self.assertEqual(converter.to_specifiers_list(configs_to_match), [set(['win7', 'mac', 'release'])])
configs_to_match = set([
@@ -314,8 +293,7 @@ class TestConfigurationConverterTest(unittest.TestCase):
TestConfiguration('win7', 'x86', 'debug'),
TestConfiguration('trusty', 'x86_64', 'release'),
])
- self.assertEqual(converter.to_specifiers_list(configs_to_match),
- [set(['win7']), set(['release', 'mac', 'trusty'])])
+ self.assertEqual(converter.to_specifiers_list(configs_to_match), [set(['win7']), set(['release', 'mac', 'trusty'])])
def test_macro_collapsing(self):
macros = {'foo': ['bar', 'baz'], 'people': ['bob', 'alice', 'john']}
@@ -339,10 +317,7 @@ class TestConfigurationConverterTest(unittest.TestCase):
def test_converter_macro_collapsing(self):
converter = TestConfigurationConverter(self._all_test_configurations, MOCK_MACROS)
- configs_to_match = set([
- TestConfiguration('vista', 'x86', 'release'),
- TestConfiguration('win7', 'x86', 'release'),
- ])
+ configs_to_match = set([TestConfiguration('vista', 'x86', 'release'), TestConfiguration('win7', 'x86', 'release'), ])
self.assertEqual(converter.to_specifiers_list(configs_to_match), [set(['win', 'release'])])
configs_to_match = set([
@@ -368,10 +343,7 @@ class TestConfigurationConverterTest(unittest.TestCase):
])
self.assertEqual(converter.to_specifiers_list(configs_to_match), [set(['win', 'mac', 'release'])])
- configs_to_match = set([
- TestConfiguration('vista', 'x86', 'release'),
- TestConfiguration('win7', 'x86', 'release'),
- ])
+ configs_to_match = set([TestConfiguration('vista', 'x86', 'release'), TestConfiguration('win7', 'x86', 'release'), ])
self.assertEqual(converter.to_specifiers_list(configs_to_match), [set(['win', 'release'])])
def test_specifier_converter_access(self):

Powered by Google App Engine
This is Rietveld 408576698