| 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..3e5be888d25383f3dd98889ef3151ac37835c963 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'], }
|
|
|
|
|
| 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,8 @@ 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 +154,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 +173,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 +202,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 +210,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 +231,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 +246,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 +258,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 +270,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 +282,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 +291,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 +315,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 +341,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):
|
|
|