--- Tools/Scripts/webkitpy/common/system/platforminfo_unittest.py.orig 2015-10-13 04:37:06 UTC +++ Tools/Scripts/webkitpy/common/system/platforminfo_unittest.py @@ -78,7 +78,7 @@ class TestPlatformInfo(unittest.TestCase self.assertNotEquals(info.os_name, '') self.assertNotEquals(info.os_version, '') self.assertNotEquals(info.display_name(), '') - self.assertTrue(info.is_mac() or info.is_win() or info.is_linux() or info.is_freebsd()) + self.assertTrue(info.is_mac() or info.is_win() or info.is_linux() or info.is_freebsd() or info.id_bsdsunix()) self.assertIsNotNone(info.terminal_width()) if info.is_mac(): @@ -92,12 +92,14 @@ class TestPlatformInfo(unittest.TestCase self.assertFalse(info.is_mac()) self.assertFalse(info.is_win()) self.assertFalse(info.is_freebsd()) + self.assertFalse(info.is_bsdsunix()) info = self.make_info(fake_sys('linux3')) self.assertTrue(info.is_linux()) self.assertFalse(info.is_mac()) self.assertFalse(info.is_win()) self.assertFalse(info.is_freebsd()) + self.assertFalse(info.is_bsdsunix()) info = self.make_info(fake_sys('darwin'), fake_platform('10.6.3')) self.assertEqual(info.os_name, 'mac') @@ -105,6 +107,7 @@ class TestPlatformInfo(unittest.TestCase self.assertTrue(info.is_mac()) self.assertFalse(info.is_win()) self.assertFalse(info.is_freebsd()) + self.assertFalse(info.is_bsdsunix()) info = self.make_info(fake_sys('win32', tuple([6, 1, 7600]))) self.assertEqual(info.os_name, 'win') @@ -112,6 +115,7 @@ class TestPlatformInfo(unittest.TestCase self.assertFalse(info.is_mac()) self.assertTrue(info.is_win()) self.assertFalse(info.is_freebsd()) + self.assertFalse(info.is_bsdsunix()) info = self.make_info(fake_sys('cygwin'), executive=fake_executive('6.1.7600')) self.assertEqual(info.os_name, 'win') @@ -119,6 +123,7 @@ class TestPlatformInfo(unittest.TestCase self.assertFalse(info.is_mac()) self.assertTrue(info.is_win()) self.assertFalse(info.is_freebsd()) + self.assertFalse(info.is_bsdsunix()) info = self.make_info(fake_sys('freebsd8')) self.assertEqual(info.os_name, 'freebsd') @@ -126,6 +131,15 @@ class TestPlatformInfo(unittest.TestCase self.assertFalse(info.is_mac()) self.assertFalse(info.is_win()) self.assertTrue(info.is_freebsd()) + self.assertFalse(info.is_bsdsunix()) + + info = self.make_info(fake_sys('bsdsunix1')) + self.assertEqual(info.os_name, 'bsdsunix') + self.assertFalse(info.is_linux()) + self.assertFalse(info.is_mac()) + self.assertFalse(info.is_win()) + self.assertFalse(info.is_freebsd()) + self.assertTrue(info.is_bsdsunix()) self.assertRaises(AssertionError, self.make_info, fake_sys('vms')) @@ -142,6 +156,8 @@ class TestPlatformInfo(unittest.TestCase self.assertEqual(self.make_info(fake_sys('freebsd8'), fake_platform('', '8.3-PRERELEASE')).os_version, '8.3-PRERELEASE') self.assertEqual(self.make_info(fake_sys('freebsd9'), fake_platform('', '9.0-RELEASE')).os_version, '9.0-RELEASE') + self.assertEqual(self.make_info(fake_sys('bsdsunix'), fake_platform('', '1.0-RELEASE')).os_version, '1.0-RELEASE') + self.assertRaises(AssertionError, self.make_info, fake_sys('win32', tuple([5, 0, 1234]))) self.assertEqual(self.make_info(fake_sys('win32', tuple([6, 2, 1234]))).os_version, 'future') self.assertEqual(self.make_info(fake_sys('win32', tuple([6, 1, 7600]))).os_version, '7sp0') @@ -167,6 +183,9 @@ class TestPlatformInfo(unittest.TestCase info = self.make_info(fake_sys('freebsd9')) self.assertNotEquals(info.display_name(), '') + info = self.make_info(fake_sys('bsdsunix1')) + self.assertNotEquals(info.display_name(), '') + def test_total_bytes_memory(self): info = self.make_info(fake_sys('darwin'), fake_platform('10.6.3'), fake_executive('1234')) self.assertEqual(info.total_bytes_memory(), 1234) @@ -179,3 +198,6 @@ class TestPlatformInfo(unittest.TestCase info = self.make_info(fake_sys('freebsd9')) self.assertIsNone(info.total_bytes_memory()) + + info = self.make_info(fake_sys('bsdsunix1')) + self.assertIsNone(info.total_bytes_memory())