| OLD | NEW |
| 1 # Copyright (C) 2011 Google Inc. All rights reserved. | 1 # Copyright (C) 2011 Google Inc. All rights reserved. |
| 2 # | 2 # |
| 3 # Redistribution and use in source and binary forms, with or without | 3 # Redistribution and use in source and binary forms, with or without |
| 4 # modification, are permitted provided that the following conditions are | 4 # modification, are permitted provided that the following conditions are |
| 5 # met: | 5 # met: |
| 6 # | 6 # |
| 7 # * Redistributions of source code must retain the above copyright | 7 # * Redistributions of source code must retain the above copyright |
| 8 # notice, this list of conditions and the following disclaimer. | 8 # notice, this list of conditions and the following disclaimer. |
| 9 # * Redistributions in binary form must reproduce the above | 9 # * Redistributions in binary form must reproduce the above |
| 10 # copyright notice, this list of conditions and the following disclaimer | 10 # copyright notice, this list of conditions and the following disclaimer |
| (...skipping 149 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 160 converter = TestConfigurationConverter(self._all_test_configurations) | 160 converter = TestConfigurationConverter(self._all_test_configurations) |
| 161 | 161 |
| 162 self.assertEqual(converter.to_config_set(set()), self._all_test_configur
ations) | 162 self.assertEqual(converter.to_config_set(set()), self._all_test_configur
ations) |
| 163 | 163 |
| 164 self.assertEqual(converter.to_config_set(set(['foo'])), set()) | 164 self.assertEqual(converter.to_config_set(set(['foo'])), set()) |
| 165 | 165 |
| 166 self.assertEqual(converter.to_config_set(set(['xp', 'foo'])), set()) | 166 self.assertEqual(converter.to_config_set(set(['xp', 'foo'])), set()) |
| 167 | 167 |
| 168 errors = [] | 168 errors = [] |
| 169 self.assertEqual(converter.to_config_set(set(['xp', 'foo']), errors), se
t()) | 169 self.assertEqual(converter.to_config_set(set(['xp', 'foo']), errors), se
t()) |
| 170 self.assertEqual(errors, ["Unrecognized modifier 'foo'"]) | 170 self.assertEqual(errors, ["Unrecognized specifier 'foo'"]) |
| 171 | 171 |
| 172 self.assertEqual(converter.to_config_set(set(['xp', 'x86_64'])), set()) | 172 self.assertEqual(converter.to_config_set(set(['xp', 'x86_64'])), set()) |
| 173 | 173 |
| 174 configs_to_match = set([ | 174 configs_to_match = set([ |
| 175 TestConfiguration('xp', 'x86', 'release'), | 175 TestConfiguration('xp', 'x86', 'release'), |
| 176 ]) | 176 ]) |
| 177 self.assertEqual(converter.to_config_set(set(['xp', 'release'])), config
s_to_match) | 177 self.assertEqual(converter.to_config_set(set(['xp', 'release'])), config
s_to_match) |
| 178 | 178 |
| 179 configs_to_match = set([ | 179 configs_to_match = set([ |
| 180 TestConfiguration('snowleopard', 'x86', 'release'), | 180 TestConfiguration('snowleopard', 'x86', 'release'), |
| (...skipping 179 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 360 TestConfiguration('xp', 'x86', 'release'), | 360 TestConfiguration('xp', 'x86', 'release'), |
| 361 TestConfiguration('vista', 'x86', 'release'), | 361 TestConfiguration('vista', 'x86', 'release'), |
| 362 TestConfiguration('win7', 'x86', 'release'), | 362 TestConfiguration('win7', 'x86', 'release'), |
| 363 ]) | 363 ]) |
| 364 self.assertEqual(converter.to_specifiers_list(configs_to_match), [set(['
win', 'release'])]) | 364 self.assertEqual(converter.to_specifiers_list(configs_to_match), [set(['
win', 'release'])]) |
| 365 | 365 |
| 366 def test_specifier_converter_access(self): | 366 def test_specifier_converter_access(self): |
| 367 specifier_sorter = TestConfigurationConverter(self._all_test_configurati
ons, MOCK_MACROS).specifier_sorter() | 367 specifier_sorter = TestConfigurationConverter(self._all_test_configurati
ons, MOCK_MACROS).specifier_sorter() |
| 368 self.assertEqual(specifier_sorter.category_for_specifier('snowleopard'),
'version') | 368 self.assertEqual(specifier_sorter.category_for_specifier('snowleopard'),
'version') |
| 369 self.assertEqual(specifier_sorter.category_for_specifier('mac'), 'versio
n') | 369 self.assertEqual(specifier_sorter.category_for_specifier('mac'), 'versio
n') |
| OLD | NEW |