| OLD | NEW |
| 1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
| 2 | 2 |
| 3 # Copyright (c) 2012 Google Inc. All rights reserved. | 3 # Copyright (c) 2012 Google Inc. All rights reserved. |
| 4 # Use of this source code is governed by a BSD-style license that can be | 4 # Use of this source code is governed by a BSD-style license that can be |
| 5 # found in the LICENSE file. | 5 # found in the LICENSE file. |
| 6 | 6 |
| 7 """Unit tests for the common.py file.""" | 7 """Unit tests for the common.py file.""" |
| 8 | 8 |
| 9 import gyp.common | 9 import gyp.common |
| 10 import unittest | 10 import unittest |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 49 self.original_platform = sys.platform | 49 self.original_platform = sys.platform |
| 50 | 50 |
| 51 def tearDown(self): | 51 def tearDown(self): |
| 52 sys.platform = self.original_platform | 52 sys.platform = self.original_platform |
| 53 | 53 |
| 54 def assertFlavor(self, expected, argument, param): | 54 def assertFlavor(self, expected, argument, param): |
| 55 sys.platform = argument | 55 sys.platform = argument |
| 56 self.assertEqual(expected, gyp.common.GetFlavor(param)) | 56 self.assertEqual(expected, gyp.common.GetFlavor(param)) |
| 57 | 57 |
| 58 def test_platform_default(self): | 58 def test_platform_default(self): |
| 59 self.assertFlavor('freebsd', 'freebsd9' , {}) | 59 self.assertFlavor('dragonflybsd', 'dragonfly3', {}) |
| 60 self.assertFlavor('freebsd', 'freebsd10', {}) | 60 self.assertFlavor('freebsd' , 'freebsd9' , {}) |
| 61 self.assertFlavor('solaris', 'sunos5' , {}); | 61 self.assertFlavor('freebsd' , 'freebsd10' , {}) |
| 62 self.assertFlavor('solaris', 'sunos' , {}); | 62 self.assertFlavor('solaris' , 'sunos5' , {}); |
| 63 self.assertFlavor('linux' , 'linux2' , {}); | 63 self.assertFlavor('solaris' , 'sunos' , {}); |
| 64 self.assertFlavor('linux' , 'linux3' , {}); | 64 self.assertFlavor('linux' , 'linux2' , {}); |
| 65 self.assertFlavor('linux' , 'linux3' , {}); |
| 65 | 66 |
| 66 def test_param(self): | 67 def test_param(self): |
| 67 self.assertFlavor('foobar', 'linux2' , {'flavor': 'foobar'}) | 68 self.assertFlavor('foobar', 'linux2' , {'flavor': 'foobar'}) |
| 68 | 69 |
| 69 | 70 |
| 70 if __name__ == '__main__': | 71 if __name__ == '__main__': |
| 71 unittest.main() | 72 unittest.main() |
| OLD | NEW |