def test_isWinNTDeprecated(self): """ L{Platform.isWinNT} is deprecated in favor of L{platform.isWindows}. """ platform = Platform() platform.isWinNT() warnings = self.flushWarnings([self.test_isWinNTDeprecated]) self.assertEqual(len(warnings), 1) self.assertEqual(warnings[0]['message'], self.isWinNTDeprecationMessage)
def test_isWinNTDeprecated(self): """ L{Platform.isWinNT} is deprecated in favor of L{platform.isWindows}. """ platform = Platform() platform.isWinNT() warnings = self.flushWarnings([self.test_isWinNTDeprecated]) self.assertEqual(len(warnings), 1) self.assertEqual( warnings[0]['message'], self.isWinNTDeprecationMessage)
def test_isVistaConsistency(self): """ Verify consistency of L{Platform.isVista}: it can only be C{True} if L{Platform.isWinNT} and L{Platform.isWindows} are C{True}. """ platform = Platform() if platform.isVista(): self.assertTrue(platform.isWinNT()) self.assertTrue(platform.isWindows()) self.assertFalse(platform.isMacOSX())
def test_isWinNT(self): """ L{Platform.isWinNT} can return only C{False} or C{True} and can not return C{True} if L{Platform.getType} is not C{"win32"}. """ platform = Platform() isWinNT = platform.isWinNT() self.assertIn(isWinNT, (False, True)) if platform.getType() != "win32": self.assertEqual(isWinNT, False)
def test_isVistaConsistency(self): """ Verify consistency of L{Platform.isVista}: it can only be C{True} if L{Platform.isWinNT} and L{Platform.isWindows} are C{True}. """ platform = Platform() if platform.isVista(): self.assertTrue(platform.isWinNT()) self.assertTrue(platform.isWindows()) self.assertFalse(platform.isMacOSX())
def test_isWinNT(self): """ L{Platform.isWinNT} can return only C{False} or C{True} and can not return C{True} if L{Platform.getType} is not C{"win32"}. """ platform = Platform() isWinNT = platform.isWinNT() self.assertIn(isWinNT, (False, True)) if platform.getType() != "win32": self.assertEqual(isWinNT, False)
def test_isWinNT(self): """ L{Platform.isWinNT} can return only C{0} or C{1} and can not return C{1} if L{Platform.getType} is not C{"win32"}. """ platform = Platform() isWinNT = platform.isWinNT() self.assertTrue(isWinNT in (0, 1)) if platform.getType() != "win32": self.assertEqual(isWinNT, 0)