for version, architecture in (('snowleopard', 'x86'), ('xp', 'x86'), ('win7', 'x86'), ('lucid', 'x86'), ('lucid', 'x86_64')):
for build_type in ('debug', 'release'):
for graphics_type in ('cpu', 'gpu'):
- all_test_configurations.add(TestConfiguration(None, version, architecture, build_type, graphics_type))
+ all_test_configurations.add(TestConfiguration(version, architecture, build_type, graphics_type))
return all_test_configurations
MOCK_MACROS = {
class TestConfigurationTest(unittest.TestCase):
def test_items(self):
- config = TestConfiguration(None, 'xp', 'x86', 'release', 'cpu')
+ config = TestConfiguration('xp', 'x86', 'release', 'cpu')
result_config_dict = {}
for category, specifier in config.items():
result_config_dict[category] = specifier
self.assertEquals({'version': 'xp', 'architecture': 'x86', 'build_type': 'release', 'graphics_type': 'cpu'}, result_config_dict)
def test_keys(self):
- config = TestConfiguration(None, 'xp', 'x86', 'release', 'cpu')
+ config = TestConfiguration('xp', 'x86', 'release', 'cpu')
result_config_keys = []
for category in config.keys():
result_config_keys.append(category)
self.assertEquals(set(['graphics_type', 'version', 'architecture', 'build_type']), set(result_config_keys))
def test_str(self):
- config = TestConfiguration(None, 'xp', 'x86', 'release', 'cpu')
+ config = TestConfiguration('xp', 'x86', 'release', 'cpu')
self.assertEquals('<xp, x86, release, cpu>', str(config))
def test_repr(self):
- config = TestConfiguration(None, 'xp', 'x86', 'release', 'cpu')
+ config = TestConfiguration('xp', 'x86', 'release', 'cpu')
self.assertEquals("TestConfig(version='xp', architecture='x86', build_type='release', graphics_type='cpu')", repr(config))
def test_hash(self):
config_dict = {}
- config_dict[TestConfiguration(None, 'xp', 'x86', 'release', 'cpu')] = True
- self.assertTrue(TestConfiguration(None, 'xp', 'x86', 'release', 'cpu') in config_dict)
- self.assertTrue(config_dict[TestConfiguration(None, 'xp', 'x86', 'release', 'cpu')])
- config_dict[TestConfiguration(None, 'xp', 'x86', 'release', 'gpu')] = False
- self.assertFalse(config_dict[TestConfiguration(None, 'xp', 'x86', 'release', 'gpu')])
+ config_dict[TestConfiguration('xp', 'x86', 'release', 'cpu')] = True
+ self.assertTrue(TestConfiguration('xp', 'x86', 'release', 'cpu') in config_dict)
+ self.assertTrue(config_dict[TestConfiguration('xp', 'x86', 'release', 'cpu')])
+ config_dict[TestConfiguration('xp', 'x86', 'release', 'gpu')] = False
+ self.assertFalse(config_dict[TestConfiguration('xp', 'x86', 'release', 'gpu')])
def query_unknown_key():
- config_dict[TestConfiguration(None, 'xp', 'x86', 'debug', 'gpu')]
+ config_dict[TestConfiguration('xp', 'x86', 'debug', 'gpu')]
self.assertRaises(KeyError, query_unknown_key)
- self.assertTrue(TestConfiguration(None, 'xp', 'x86', 'release', 'gpu') in config_dict)
- self.assertFalse(TestConfiguration(None, 'xp', 'x86', 'debug', 'gpu') in config_dict)
- configs_list = [TestConfiguration(None, 'xp', 'x86', 'release', 'gpu'), TestConfiguration(None, 'xp', 'x86', 'debug', 'gpu'), TestConfiguration(None, 'xp', 'x86', 'debug', 'gpu')]
+ self.assertTrue(TestConfiguration('xp', 'x86', 'release', 'gpu') in config_dict)
+ self.assertFalse(TestConfiguration('xp', 'x86', 'debug', 'gpu') in config_dict)
+ configs_list = [TestConfiguration('xp', 'x86', 'release', 'gpu'), TestConfiguration('xp', 'x86', 'debug', 'gpu'), TestConfiguration('xp', 'x86', 'debug', 'gpu')]
self.assertEquals(len(configs_list), 3)
self.assertEquals(len(set(configs_list)), 2)
def test_eq(self):
- self.assertEquals(TestConfiguration(None, 'xp', 'x86', 'release', 'cpu'), TestConfiguration(None, 'xp', 'x86', 'release', 'cpu'))
- self.assertEquals(TestConfiguration(port.get('test-win-xp', None)), TestConfiguration(None, 'xp', 'x86', 'release', 'cpu'))
- self.assertNotEquals(TestConfiguration(None, 'xp', 'x86', 'release', 'gpu'), TestConfiguration(None, 'xp', 'x86', 'release', 'cpu'))
- self.assertNotEquals(TestConfiguration(None, 'xp', 'x86', 'debug', 'cpu'), TestConfiguration(None, 'xp', 'x86', 'release', 'cpu'))
+ self.assertEquals(TestConfiguration('xp', 'x86', 'release', 'cpu'), TestConfiguration('xp', 'x86', 'release', 'cpu'))
+ self.assertEquals(TestConfiguration.from_port(port.get('test-win-xp', None)), TestConfiguration('xp', 'x86', 'release', 'cpu'))
+ self.assertNotEquals(TestConfiguration('xp', 'x86', 'release', 'gpu'), TestConfiguration('xp', 'x86', 'release', 'cpu'))
+ self.assertNotEquals(TestConfiguration('xp', 'x86', 'debug', 'cpu'), TestConfiguration('xp', 'x86', 'release', 'cpu'))
def test_values(self):
- config = TestConfiguration(None, 'xp', 'x86', 'release', 'cpu')
+ config = TestConfiguration('xp', 'x86', 'release', 'cpu')
result_config_values = []
for value in config.values():
result_config_values.append(value)
self.assertEquals(set(['xp', 'x86', 'release', 'cpu']), set(result_config_values))
- def test_port_init(self):
- config = TestConfiguration(port.get('test-win-xp', None))
+ def test_from_port(self):
+ config = TestConfiguration.from_port(port.get('test-win-xp', None))
self.assertEquals('<xp, x86, release, cpu>', str(config))
self.assertEquals(converter.to_config_set(set(['xp', 'x86_64'])), set())
configs_to_match = set([
- TestConfiguration(None, 'xp', 'x86', 'release', 'gpu'),
- TestConfiguration(None, 'xp', 'x86', 'release', 'cpu'),
+ TestConfiguration('xp', 'x86', 'release', 'gpu'),
+ TestConfiguration('xp', 'x86', 'release', 'cpu'),
])
self.assertEquals(converter.to_config_set(set(['xp', 'release'])), configs_to_match)
configs_to_match = set([
- TestConfiguration(None, 'snowleopard', 'x86', 'release', 'gpu'),
- TestConfiguration(None, 'win7', 'x86', 'release', 'gpu'),
- TestConfiguration(None, 'xp', 'x86', 'release', 'gpu'),
- TestConfiguration(None, 'lucid', 'x86', 'release', 'gpu'),
- TestConfiguration(None, 'lucid', 'x86_64', 'release', 'gpu'),
+ TestConfiguration('snowleopard', 'x86', 'release', 'gpu'),
+ TestConfiguration('win7', 'x86', 'release', 'gpu'),
+ TestConfiguration('xp', 'x86', 'release', 'gpu'),
+ TestConfiguration('lucid', 'x86', 'release', 'gpu'),
+ TestConfiguration('lucid', 'x86_64', 'release', 'gpu'),
])
self.assertEquals(converter.to_config_set(set(['gpu', 'release'])), configs_to_match)
configs_to_match = set([
- TestConfiguration(None, 'lucid', 'x86_64', 'release', 'gpu'),
- TestConfiguration(None, 'lucid', 'x86_64', 'debug', 'gpu'),
- TestConfiguration(None, 'lucid', 'x86_64', 'release', 'cpu'),
- TestConfiguration(None, 'lucid', 'x86_64', 'debug', 'cpu'),
+ TestConfiguration('lucid', 'x86_64', 'release', 'gpu'),
+ TestConfiguration('lucid', 'x86_64', 'debug', 'gpu'),
+ TestConfiguration('lucid', 'x86_64', 'release', 'cpu'),
+ TestConfiguration('lucid', 'x86_64', 'debug', 'cpu'),
])
self.assertEquals(converter.to_config_set(set(['x86_64'])), configs_to_match)
configs_to_match = set([
- TestConfiguration(None, 'lucid', 'x86_64', 'release', 'gpu'),
- TestConfiguration(None, 'lucid', 'x86_64', 'debug', 'gpu'),
- TestConfiguration(None, 'lucid', 'x86_64', 'release', 'cpu'),
- TestConfiguration(None, 'lucid', 'x86_64', 'debug', 'cpu'),
- TestConfiguration(None, 'lucid', 'x86', 'release', 'gpu'),
- TestConfiguration(None, 'lucid', 'x86', 'debug', 'gpu'),
- TestConfiguration(None, 'lucid', 'x86', 'release', 'cpu'),
- TestConfiguration(None, 'lucid', 'x86', 'debug', 'cpu'),
- TestConfiguration(None, 'snowleopard', 'x86', 'release', 'gpu'),
- TestConfiguration(None, 'snowleopard', 'x86', 'debug', 'gpu'),
- TestConfiguration(None, 'snowleopard', 'x86', 'release', 'cpu'),
- TestConfiguration(None, 'snowleopard', 'x86', 'debug', 'cpu'),
+ TestConfiguration('lucid', 'x86_64', 'release', 'gpu'),
+ TestConfiguration('lucid', 'x86_64', 'debug', 'gpu'),
+ TestConfiguration('lucid', 'x86_64', 'release', 'cpu'),
+ TestConfiguration('lucid', 'x86_64', 'debug', 'cpu'),
+ TestConfiguration('lucid', 'x86', 'release', 'gpu'),
+ TestConfiguration('lucid', 'x86', 'debug', 'gpu'),
+ TestConfiguration('lucid', 'x86', 'release', 'cpu'),
+ TestConfiguration('lucid', 'x86', 'debug', 'cpu'),
+ TestConfiguration('snowleopard', 'x86', 'release', 'gpu'),
+ TestConfiguration('snowleopard', 'x86', 'debug', 'gpu'),
+ TestConfiguration('snowleopard', 'x86', 'release', 'cpu'),
+ TestConfiguration('snowleopard', 'x86', 'debug', 'cpu'),
])
self.assertEquals(converter.to_config_set(set(['lucid', 'snowleopard'])), configs_to_match)
configs_to_match = set([
- TestConfiguration(None, 'lucid', 'x86', 'release', 'gpu'),
- TestConfiguration(None, 'lucid', 'x86', 'debug', 'gpu'),
- TestConfiguration(None, 'lucid', 'x86', 'release', 'cpu'),
- TestConfiguration(None, 'lucid', 'x86', 'debug', 'cpu'),
- TestConfiguration(None, 'snowleopard', 'x86', 'release', 'gpu'),
- TestConfiguration(None, 'snowleopard', 'x86', 'debug', 'gpu'),
- TestConfiguration(None, 'snowleopard', 'x86', 'release', 'cpu'),
- TestConfiguration(None, 'snowleopard', 'x86', 'debug', 'cpu'),
+ TestConfiguration('lucid', 'x86', 'release', 'gpu'),
+ TestConfiguration('lucid', 'x86', 'debug', 'gpu'),
+ TestConfiguration('lucid', 'x86', 'release', 'cpu'),
+ TestConfiguration('lucid', 'x86', 'debug', 'cpu'),
+ TestConfiguration('snowleopard', 'x86', 'release', 'gpu'),
+ TestConfiguration('snowleopard', 'x86', 'debug', 'gpu'),
+ TestConfiguration('snowleopard', 'x86', 'release', 'cpu'),
+ TestConfiguration('snowleopard', 'x86', 'debug', 'cpu'),
])
self.assertEquals(converter.to_config_set(set(['lucid', 'snowleopard', 'x86'])), configs_to_match)
configs_to_match = set([
- TestConfiguration(None, 'lucid', 'x86_64', 'release', 'cpu'),
- TestConfiguration(None, 'lucid', 'x86', 'release', 'cpu'),
- TestConfiguration(None, 'snowleopard', 'x86', 'release', 'cpu'),
+ TestConfiguration('lucid', 'x86_64', 'release', 'cpu'),
+ TestConfiguration('lucid', 'x86', 'release', 'cpu'),
+ TestConfiguration('snowleopard', 'x86', 'release', 'cpu'),
])
self.assertEquals(converter.to_config_set(set(['lucid', 'snowleopard', 'release', 'cpu'])), configs_to_match)
converter = TestConfigurationConverter(self._all_test_configurations, MOCK_MACROS)
configs_to_match = set([
- TestConfiguration(None, 'xp', 'x86', 'release', 'gpu'),
- TestConfiguration(None, 'xp', 'x86', 'release', 'cpu'),
- TestConfiguration(None, 'win7', 'x86', 'release', 'gpu'),
- TestConfiguration(None, 'win7', 'x86', 'release', 'cpu'),
+ TestConfiguration('xp', 'x86', 'release', 'gpu'),
+ TestConfiguration('xp', 'x86', 'release', 'cpu'),
+ TestConfiguration('win7', 'x86', 'release', 'gpu'),
+ TestConfiguration('win7', 'x86', 'release', 'cpu'),
])
self.assertEquals(converter.to_config_set(set(['win', 'release'])), configs_to_match)
configs_to_match = set([
- TestConfiguration(None, 'xp', 'x86', 'release', 'gpu'),
- TestConfiguration(None, 'win7', 'x86', 'release', 'gpu'),
- TestConfiguration(None, 'lucid', 'x86', 'release', 'gpu'),
- TestConfiguration(None, 'lucid', 'x86_64', 'release', 'gpu'),
+ TestConfiguration('xp', 'x86', 'release', 'gpu'),
+ TestConfiguration('win7', 'x86', 'release', 'gpu'),
+ TestConfiguration('lucid', 'x86', 'release', 'gpu'),
+ TestConfiguration('lucid', 'x86_64', 'release', 'gpu'),
])
self.assertEquals(converter.to_config_set(set(['win', 'lucid', 'release', 'gpu'])), configs_to_match)
configs_to_match = set([
- TestConfiguration(None, 'xp', 'x86', 'release', 'gpu'),
- TestConfiguration(None, 'win7', 'x86', 'release', 'gpu'),
- TestConfiguration(None, 'snowleopard', 'x86', 'release', 'gpu'),
+ TestConfiguration('xp', 'x86', 'release', 'gpu'),
+ TestConfiguration('win7', 'x86', 'release', 'gpu'),
+ TestConfiguration('snowleopard', 'x86', 'release', 'gpu'),
])
self.assertEquals(converter.to_config_set(set(['win', 'mac', 'release', 'gpu'])), configs_to_match)
self.assertEquals(converter.to_specifiers_list(set()), [])
configs_to_match = set([
- TestConfiguration(None, 'xp', 'x86', 'release', 'gpu'),
- TestConfiguration(None, 'xp', 'x86', 'release', 'cpu'),
+ TestConfiguration('xp', 'x86', 'release', 'gpu'),
+ TestConfiguration('xp', 'x86', 'release', 'cpu'),
])
self.assertEquals(converter.to_specifiers_list(configs_to_match), [set(['release', 'xp'])])
configs_to_match = set([
- TestConfiguration(None, 'xp', 'x86', 'release', 'gpu'),
- TestConfiguration(None, 'xp', 'x86', 'release', 'cpu'),
- TestConfiguration(None, 'xp', 'x86', 'debug', 'gpu'),
- TestConfiguration(None, 'xp', 'x86', 'debug', 'cpu'),
+ TestConfiguration('xp', 'x86', 'release', 'gpu'),
+ TestConfiguration('xp', 'x86', 'release', 'cpu'),
+ TestConfiguration('xp', 'x86', 'debug', 'gpu'),
+ TestConfiguration('xp', 'x86', 'debug', 'cpu'),
])
self.assertEquals(converter.to_specifiers_list(configs_to_match), [set(['xp'])])
configs_to_match = set([
- TestConfiguration(None, 'xp', 'x86', 'release', 'gpu'),
- TestConfiguration(None, 'lucid', 'x86_64', 'debug', 'cpu'),
+ TestConfiguration('xp', 'x86', 'release', 'gpu'),
+ TestConfiguration('lucid', 'x86_64', 'debug', 'cpu'),
])
self.assertEquals(converter.to_specifiers_list(configs_to_match), [set(['debug', 'x86_64', 'lucid', 'cpu']), set(['release', 'gpu', 'xp'])])
configs_to_match = set([
- TestConfiguration(None, 'xp', 'x86', 'release', 'gpu'),
- TestConfiguration(None, 'xp', 'x86', 'release', 'cpu'),
- TestConfiguration(None, 'lucid', 'x86_64', 'debug', 'cpu'),
- TestConfiguration(None, 'lucid', 'x86', 'debug', 'cpu'),
- TestConfiguration(None, 'lucid', 'x86_64', 'debug', 'gpu'),
- TestConfiguration(None, 'lucid', 'x86', 'debug', 'gpu'),
+ TestConfiguration('xp', 'x86', 'release', 'gpu'),
+ TestConfiguration('xp', 'x86', 'release', 'cpu'),
+ TestConfiguration('lucid', 'x86_64', 'debug', 'cpu'),
+ TestConfiguration('lucid', 'x86', 'debug', 'cpu'),
+ TestConfiguration('lucid', 'x86_64', 'debug', 'gpu'),
+ TestConfiguration('lucid', 'x86', 'debug', 'gpu'),
])
self.assertEquals(converter.to_specifiers_list(configs_to_match), [set(['release', 'xp']), set(['debug', 'lucid'])])
configs_to_match = set([
- TestConfiguration(None, 'xp', 'x86', 'release', 'gpu'),
- TestConfiguration(None, 'snowleopard', 'x86', 'release', 'gpu'),
- TestConfiguration(None, 'win7', 'x86', 'release', 'gpu'),
- TestConfiguration(None, 'lucid', 'x86', 'release', 'gpu'),
- TestConfiguration(None, 'lucid', 'x86_64', 'release', 'gpu'),
+ TestConfiguration('xp', 'x86', 'release', 'gpu'),
+ TestConfiguration('snowleopard', 'x86', 'release', 'gpu'),
+ TestConfiguration('win7', 'x86', 'release', 'gpu'),
+ TestConfiguration('lucid', 'x86', 'release', 'gpu'),
+ TestConfiguration('lucid', 'x86_64', 'release', 'gpu'),
])
self.assertEquals(converter.to_specifiers_list(configs_to_match), [set(['release', 'gpu'])])
configs_to_match = set([
- TestConfiguration(None, 'xp', 'x86', 'release', 'gpu'),
- TestConfiguration(None, 'snowleopard', 'x86', 'release', 'gpu'),
+ TestConfiguration('xp', 'x86', 'release', 'gpu'),
+ TestConfiguration('snowleopard', 'x86', 'release', 'gpu'),
])
self.assertEquals(converter.to_specifiers_list(configs_to_match), [set(['xp', 'snowleopard', 'release', 'gpu'])])
configs_to_match = set([
- TestConfiguration(None, 'xp', 'x86', 'release', 'gpu'),
- TestConfiguration(None, 'snowleopard', 'x86', 'release', 'gpu'),
- TestConfiguration(None, 'win7', 'x86', 'release', 'gpu'),
- TestConfiguration(None, 'win7', 'x86', 'debug', 'gpu'),
- TestConfiguration(None, 'lucid', 'x86', 'release', 'gpu'),
+ TestConfiguration('xp', 'x86', 'release', 'gpu'),
+ TestConfiguration('snowleopard', 'x86', 'release', 'gpu'),
+ TestConfiguration('win7', 'x86', 'release', 'gpu'),
+ TestConfiguration('win7', 'x86', 'debug', 'gpu'),
+ TestConfiguration('lucid', 'x86', 'release', 'gpu'),
])
self.assertEquals(converter.to_specifiers_list(configs_to_match), [set(['release', 'gpu', 'lucid', 'x86']), set(['gpu', 'win7']), set(['release', 'gpu', 'xp', 'snowleopard'])])
converter = TestConfigurationConverter(self._all_test_configurations, MOCK_MACROS)
configs_to_match = set([
- TestConfiguration(None, 'xp', 'x86', 'release', 'gpu'),
- TestConfiguration(None, 'xp', 'x86', 'release', 'cpu'),
- TestConfiguration(None, 'win7', 'x86', 'release', 'gpu'),
- TestConfiguration(None, 'win7', 'x86', 'release', 'cpu'),
+ TestConfiguration('xp', 'x86', 'release', 'gpu'),
+ TestConfiguration('xp', 'x86', 'release', 'cpu'),
+ TestConfiguration('win7', 'x86', 'release', 'gpu'),
+ TestConfiguration('win7', 'x86', 'release', 'cpu'),
])
self.assertEquals(converter.to_specifiers_list(configs_to_match), [set(['win', 'release'])])
configs_to_match = set([
- TestConfiguration(None, 'xp', 'x86', 'release', 'gpu'),
- TestConfiguration(None, 'win7', 'x86', 'release', 'gpu'),
- TestConfiguration(None, 'lucid', 'x86', 'release', 'gpu'),
- TestConfiguration(None, 'lucid', 'x86_64', 'release', 'gpu'),
+ TestConfiguration('xp', 'x86', 'release', 'gpu'),
+ TestConfiguration('win7', 'x86', 'release', 'gpu'),
+ TestConfiguration('lucid', 'x86', 'release', 'gpu'),
+ TestConfiguration('lucid', 'x86_64', 'release', 'gpu'),
])
self.assertEquals(converter.to_specifiers_list(configs_to_match), [set(['win', 'linux', 'release', 'gpu'])])
configs_to_match = set([
- TestConfiguration(None, 'xp', 'x86', 'release', 'gpu'),
- TestConfiguration(None, 'win7', 'x86', 'release', 'gpu'),
- TestConfiguration(None, 'snowleopard', 'x86', 'release', 'gpu'),
+ TestConfiguration('xp', 'x86', 'release', 'gpu'),
+ TestConfiguration('win7', 'x86', 'release', 'gpu'),
+ TestConfiguration('snowleopard', 'x86', 'release', 'gpu'),
])
self.assertEquals(converter.to_specifiers_list(configs_to_match), [set(['win', 'mac', 'release', 'gpu'])])
expectation_line.name = 'test/name/for/realz.html'
expectation_line.parsed_expectations = set([IMAGE])
self.assertEqual(self._serializer.to_string(expectation_line), None)
- expectation_line.matching_configurations = set([TestConfiguration(None, 'xp', 'x86', 'release', 'cpu')])
+ expectation_line.matching_configurations = set([TestConfiguration('xp', 'x86', 'release', 'cpu')])
self.assertEqual(self._serializer.to_string(expectation_line), 'BUGX XP RELEASE CPU : test/name/for/realz.html = IMAGE')
- expectation_line.matching_configurations = set([TestConfiguration(None, 'xp', 'x86', 'release', 'cpu'), TestConfiguration(None, 'xp', 'x86', 'release', 'gpu')])
+ expectation_line.matching_configurations = set([TestConfiguration('xp', 'x86', 'release', 'cpu'), TestConfiguration('xp', 'x86', 'release', 'gpu')])
self.assertEqual(self._serializer.to_string(expectation_line), 'BUGX XP RELEASE : test/name/for/realz.html = IMAGE')
- expectation_line.matching_configurations = set([TestConfiguration(None, 'xp', 'x86', 'release', 'cpu'), TestConfiguration(None, 'xp', 'x86', 'debug', 'gpu')])
+ expectation_line.matching_configurations = set([TestConfiguration('xp', 'x86', 'release', 'cpu'), TestConfiguration('xp', 'x86', 'debug', 'gpu')])
self.assertEqual(self._serializer.to_string(expectation_line), 'BUGX XP RELEASE CPU : test/name/for/realz.html = IMAGE\nBUGX XP DEBUG GPU : test/name/for/realz.html = IMAGE')
def test_parsed_expectations_string(self):
if reconstitute:
reconstitute_only_these.append(expectation_line)
- add_line(set([TestConfiguration(None, 'xp', 'x86', 'release', 'cpu')]), False)
- add_line(set([TestConfiguration(None, 'xp', 'x86', 'release', 'cpu'), TestConfiguration(None, 'xp', 'x86', 'release', 'gpu')]), True)
- add_line(set([TestConfiguration(None, 'xp', 'x86', 'release', 'cpu'), TestConfiguration(None, 'xp', 'x86', 'debug', 'gpu')]), False)
+ add_line(set([TestConfiguration('xp', 'x86', 'release', 'cpu')]), False)
+ add_line(set([TestConfiguration('xp', 'x86', 'release', 'cpu'), TestConfiguration('xp', 'x86', 'release', 'gpu')]), True)
+ add_line(set([TestConfiguration('xp', 'x86', 'release', 'cpu'), TestConfiguration('xp', 'x86', 'debug', 'gpu')]), False)
serialized = TestExpectationSerializer.list_to_string(lines, self._converter)
self.assertEquals(serialized, "BUGX XP RELEASE CPU : Yay = IMAGE\nBUGX XP RELEASE : Yay = IMAGE\nBUGX XP RELEASE CPU : Yay = IMAGE\nBUGX XP DEBUG GPU : Yay = IMAGE")
serialized = TestExpectationSerializer.list_to_string(lines, self._converter, reconstitute_only_these=reconstitute_only_these)
class TestExpectationEditorTests(unittest.TestCase):
WIN_RELEASE_CPU_CONFIGS = set([
- TestConfiguration(None, 'vista', 'x86', 'release', 'cpu'),
- TestConfiguration(None, 'win7', 'x86', 'release', 'cpu'),
- TestConfiguration(None, 'xp', 'x86', 'release', 'cpu'),
+ TestConfiguration('vista', 'x86', 'release', 'cpu'),
+ TestConfiguration('win7', 'x86', 'release', 'cpu'),
+ TestConfiguration('xp', 'x86', 'release', 'cpu'),
])
RELEASE_CONFIGS = set([
- TestConfiguration(None, 'vista', 'x86', 'release', 'cpu'),
- TestConfiguration(None, 'win7', 'x86', 'release', 'cpu'),
- TestConfiguration(None, 'xp', 'x86', 'release', 'cpu'),
- TestConfiguration(None, 'vista', 'x86', 'release', 'gpu'),
- TestConfiguration(None, 'win7', 'x86', 'release', 'gpu'),
- TestConfiguration(None, 'xp', 'x86', 'release', 'gpu'),
- TestConfiguration(None, 'snowleopard', 'x86', 'release', 'cpu'),
- TestConfiguration(None, 'leopard', 'x86', 'release', 'cpu'),
- TestConfiguration(None, 'snowleopard', 'x86', 'release', 'gpu'),
- TestConfiguration(None, 'leopard', 'x86', 'release', 'gpu'),
- TestConfiguration(None, 'lucid', 'x86', 'release', 'cpu'),
- TestConfiguration(None, 'lucid', 'x86_64', 'release', 'cpu'),
- TestConfiguration(None, 'lucid', 'x86', 'release', 'gpu'),
- TestConfiguration(None, 'lucid', 'x86_64', 'release', 'gpu'),
+ TestConfiguration('vista', 'x86', 'release', 'cpu'),
+ TestConfiguration('win7', 'x86', 'release', 'cpu'),
+ TestConfiguration('xp', 'x86', 'release', 'cpu'),
+ TestConfiguration('vista', 'x86', 'release', 'gpu'),
+ TestConfiguration('win7', 'x86', 'release', 'gpu'),
+ TestConfiguration('xp', 'x86', 'release', 'gpu'),
+ TestConfiguration('snowleopard', 'x86', 'release', 'cpu'),
+ TestConfiguration('leopard', 'x86', 'release', 'cpu'),
+ TestConfiguration('snowleopard', 'x86', 'release', 'gpu'),
+ TestConfiguration('leopard', 'x86', 'release', 'gpu'),
+ TestConfiguration('lucid', 'x86', 'release', 'cpu'),
+ TestConfiguration('lucid', 'x86_64', 'release', 'cpu'),
+ TestConfiguration('lucid', 'x86', 'release', 'gpu'),
+ TestConfiguration('lucid', 'x86_64', 'release', 'gpu'),
])
def __init__(self, testFunc):
editor = TestExpectationsEditor(expectation_lines, MockBugManager())
test = "failures/expected/keyboard.html"
- editor.remove_expectation(test, set([TestConfiguration(None, 'xp', 'x86', 'release', 'cpu')]))
+ editor.remove_expectation(test, set([TestConfiguration('xp', 'x86', 'release', 'cpu')]))
self.assertEquals(TestExpectationSerializer.list_to_string(expectation_lines, converter), """
BUGX1 XP RELEASE GPU : failures/expected/keyboard.html = IMAGE
BUGX1 XP DEBUG : failures/expected/keyboard.html = IMAGE
BUGX1 VISTA WIN7 : failures/expected/keyboard.html = IMAGE
BUGX2 WIN : failures/expected/audio.html = IMAGE""")
- editor.remove_expectation(test, set([TestConfiguration(None, 'xp', 'x86', 'debug', 'cpu')]))
+ editor.remove_expectation(test, set([TestConfiguration('xp', 'x86', 'debug', 'cpu')]))
self.assertEquals(TestExpectationSerializer.list_to_string(expectation_lines, converter), """
BUGX1 XP GPU : failures/expected/keyboard.html = IMAGE
BUGX1 VISTA WIN7 : failures/expected/keyboard.html = IMAGE
BUGX2 WIN : failures/expected/audio.html = IMAGE""")
- editor.remove_expectation(test, set([TestConfiguration(None, 'vista', 'x86', 'debug', 'gpu'), TestConfiguration(None, 'win7', 'x86', 'release', 'gpu')]))
+ editor.remove_expectation(test, set([TestConfiguration('vista', 'x86', 'debug', 'gpu'), TestConfiguration('win7', 'x86', 'release', 'gpu')]))
self.assertEquals(TestExpectationSerializer.list_to_string(expectation_lines, converter), """
BUGX1 VISTA DEBUG CPU : failures/expected/keyboard.html = IMAGE
BUGX1 WIN7 DEBUG GPU : failures/expected/keyboard.html = IMAGE
BUGX1 VISTA RELEASE : failures/expected/keyboard.html = IMAGE
BUGX2 WIN : failures/expected/audio.html = IMAGE""")
- editor.remove_expectation(test, set([TestConfiguration(None, 'xp', 'x86', 'debug', 'gpu'), TestConfiguration(None, 'xp', 'x86', 'release', 'gpu')]))
+ editor.remove_expectation(test, set([TestConfiguration('xp', 'x86', 'debug', 'gpu'), TestConfiguration('xp', 'x86', 'release', 'gpu')]))
self.assertEquals(TestExpectationSerializer.list_to_string(expectation_lines, converter), """
BUGX1 VISTA DEBUG CPU : failures/expected/keyboard.html = IMAGE
BUGX1 WIN7 RELEASE CPU : failures/expected/keyboard.html = IMAGE
BUGX1 VISTA RELEASE : failures/expected/keyboard.html = IMAGE
BUGX2 WIN : failures/expected/audio.html = IMAGE""")
- editor.remove_expectation(test, set([TestConfiguration(None, 'vista', 'x86', 'debug', 'cpu'), TestConfiguration(None, 'vista', 'x86', 'debug', 'gpu'), TestConfiguration(None, 'vista', 'x86', 'release', 'gpu')]))
+ editor.remove_expectation(test, set([TestConfiguration('vista', 'x86', 'debug', 'cpu'), TestConfiguration('vista', 'x86', 'debug', 'gpu'), TestConfiguration('vista', 'x86', 'release', 'gpu')]))
self.assertEquals(TestExpectationSerializer.list_to_string(expectation_lines, converter), """
BUGX1 WIN7 DEBUG : failures/expected/keyboard.html = IMAGE
BUGX1 VISTA WIN7 RELEASE CPU : failures/expected/keyboard.html = IMAGE
editor = TestExpectationsEditor(expectation_lines, MockBugManager())
test = "failures/expected/keyboard.html"
- editor.update_expectation(test, set([TestConfiguration(None, 'xp', 'x86', 'release', 'cpu')]), set([IMAGE_PLUS_TEXT]), ['BUG_UPDATE1'])
+ editor.update_expectation(test, set([TestConfiguration('xp', 'x86', 'release', 'cpu')]), set([IMAGE_PLUS_TEXT]), ['BUG_UPDATE1'])
self.assertEquals(TestExpectationSerializer.list_to_string(expectation_lines, converter), """
BUGX1 XP DEBUG CPU : failures/expected/keyboard.html = IMAGE
BUGX1 XP GPU : failures/expected/keyboard.html = IMAGE
BUGX2 WIN : failures/expected/audio.html = IMAGE
BUG_UPDATE1 XP RELEASE CPU : failures/expected/keyboard.html = IMAGE+TEXT""")
- editor.update_expectation(test, set([TestConfiguration(None, 'xp', 'x86', 'debug', 'cpu')]), set([TEXT]), ['BUG_UPDATE2'])
+ editor.update_expectation(test, set([TestConfiguration('xp', 'x86', 'debug', 'cpu')]), set([TEXT]), ['BUG_UPDATE2'])
self.assertEquals(TestExpectationSerializer.list_to_string(expectation_lines, converter), """
BUGX1 XP GPU : failures/expected/keyboard.html = IMAGE
BUGX1 VISTA WIN7 : failures/expected/keyboard.html = IMAGE