| 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 128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 139 self.assertRaises(AssertionError, self.make_info, fake_sys('vms')) | 139 self.assertRaises(AssertionError, self.make_info, fake_sys('vms')) |
| 140 | 140 |
| 141 def test_os_version(self): | 141 def test_os_version(self): |
| 142 self.assertRaises(AssertionError, self.make_info, fake_sys('darwin'), fa
ke_platform('10.4.3')) | 142 self.assertRaises(AssertionError, self.make_info, fake_sys('darwin'), fa
ke_platform('10.4.3')) |
| 143 self.assertEqual(self.make_info(fake_sys('darwin'), fake_platform('10.9.
0')).os_version, 'mac10.9') | 143 self.assertEqual(self.make_info(fake_sys('darwin'), fake_platform('10.9.
0')).os_version, 'mac10.9') |
| 144 self.assertEqual(self.make_info(fake_sys('darwin'), fake_platform('10.10
.0')).os_version, 'mac10.10') | 144 self.assertEqual(self.make_info(fake_sys('darwin'), fake_platform('10.10
.0')).os_version, 'mac10.10') |
| 145 self.assertEqual(self.make_info(fake_sys('darwin'), fake_platform('10.11
.0')).os_version, 'mac10.11') | 145 self.assertEqual(self.make_info(fake_sys('darwin'), fake_platform('10.11
.0')).os_version, 'mac10.11') |
| 146 self.assertEqual(self.make_info(fake_sys('darwin'), fake_platform('10.12
.0')).os_version, 'future') | 146 self.assertEqual(self.make_info(fake_sys('darwin'), fake_platform('10.12
.0')).os_version, 'future') |
| 147 | 147 |
| 148 self.assertEqual(self.make_info(fake_sys('linux2')).os_version, 'trusty'
) | 148 self.assertEqual(self.make_info(fake_sys('linux2')).os_version, 'trusty'
) |
| 149 info = self.make_info(fake_sys('linux2'), fake_platform(linux_version='p
recise')) | |
| 150 self.assertEqual(info.os_version, 'precise') | |
| 151 info = self.make_info(fake_sys('linux2'), fake_platform(linux_version='u
topic')) | 149 info = self.make_info(fake_sys('linux2'), fake_platform(linux_version='u
topic')) |
| 152 self.assertEqual(info.os_version, 'trusty') | 150 self.assertEqual(info.os_version, 'trusty') |
| 153 | 151 |
| 154 self.assertEqual(self.make_info(fake_sys('freebsd8'), fake_platform('',
'8.3-PRERELEASE')).os_version, '8.3-PRERELEASE') | 152 self.assertEqual(self.make_info(fake_sys('freebsd8'), fake_platform('',
'8.3-PRERELEASE')).os_version, '8.3-PRERELEASE') |
| 155 self.assertEqual(self.make_info(fake_sys('freebsd9'), fake_platform('',
'9.0-RELEASE')).os_version, '9.0-RELEASE') | 153 self.assertEqual(self.make_info(fake_sys('freebsd9'), fake_platform('',
'9.0-RELEASE')).os_version, '9.0-RELEASE') |
| 156 | 154 |
| 157 self.assertRaises(AssertionError, self.make_info, fake_sys('win32', tupl
e([5, 0, 1234]))) | 155 self.assertRaises(AssertionError, self.make_info, fake_sys('win32', tupl
e([5, 0, 1234]))) |
| 158 self.assertRaises(AssertionError, self.make_info, fake_sys('win32', tupl
e([6, 1, 1234]))) | 156 self.assertRaises(AssertionError, self.make_info, fake_sys('win32', tupl
e([6, 1, 1234]))) |
| 159 self.assertEqual(self.make_info(fake_sys('win32', tuple([10, 1, 1234])))
.os_version, 'future') | 157 self.assertEqual(self.make_info(fake_sys('win32', tuple([10, 1, 1234])))
.os_version, 'future') |
| 160 self.assertEqual(self.make_info(fake_sys('win32', tuple([10, 0, 1234])))
.os_version, '10') | 158 self.assertEqual(self.make_info(fake_sys('win32', tuple([10, 0, 1234])))
.os_version, '10') |
| (...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 209 self.assertEqual(info.total_bytes_memory(), 1234) | 207 self.assertEqual(info.total_bytes_memory(), 1234) |
| 210 | 208 |
| 211 info = self.make_info(fake_sys('win32', tuple([6, 1, 7600]))) | 209 info = self.make_info(fake_sys('win32', tuple([6, 1, 7600]))) |
| 212 self.assertIsNone(info.total_bytes_memory()) | 210 self.assertIsNone(info.total_bytes_memory()) |
| 213 | 211 |
| 214 info = self.make_info(fake_sys('linux2')) | 212 info = self.make_info(fake_sys('linux2')) |
| 215 self.assertIsNone(info.total_bytes_memory()) | 213 self.assertIsNone(info.total_bytes_memory()) |
| 216 | 214 |
| 217 info = self.make_info(fake_sys('freebsd9')) | 215 info = self.make_info(fake_sys('freebsd9')) |
| 218 self.assertIsNone(info.total_bytes_memory()) | 216 self.assertIsNone(info.total_bytes_memory()) |
| OLD | NEW |