def check_platform(platform): return lambda self: self.checkTrue(gpplatform.get_info() == platform)
def test_platform_get_info(self): platforms = ["OSX", "SUSE", "RHEL5", "RHEL6", "SOL"] for platform in platforms: check = gpplatform.get_info() == platform if check: self.assertTrue(check)
The logic here is equivalent to the step "(int) (x - y)" where x and y are 32-bit unsigned int variables in TransactionIdPrecedes() in transam.c. """ diff = x - y if diff >= 2**31: ret = x elif diff > 0: ret = y elif diff > -2**31: ret = x else: # diff <= -2**31 ret = y return ret @unittest.skipIf(gpplatform.get_info() == "SOL", "Skipping Solaris, cannot compile xidhelper.so") class XidlimitsTests(MPPTestCase): """ @description Xidlimits Tests @created 2013-02-12 00:00:00 @modified 2013-02-12 00:00:00 @tags vacuum xidlimits echo @gucs gp_create_table_random_default_distribution=off """ # Constants identifying the limit to exceed. WARN_LIMIT = 0 STOP_LIMIT = 1 WRAP_LIMIT = 2
import unittest2 as unittest import tinctest.lib.gpplatform as gpplatform platforms = ["OSX", "SUSE", "RHEL5", "RHEL6", "SOL"] class PlatformTestCase(unittest.TestCase): def test_platform_get_info(self): platforms = ["OSX", "SUSE", "RHEL5", "RHEL6", "SOL"] for platform in platforms: check = gpplatform.get_info() == platform if check: self.assertTrue(check) def checkTrue(self, check): if check: self.assertTrue(check) else: self.assertFalse(check) for platform in platforms: def check_platform(platform): return lambda self: self.checkTrue(gpplatform.get_info() == platform) setattr(PlatformTestCase, "test_platform%r_%s" % (platform, gpplatform.get_info() == platform), check_platform(platform))
Returns the xid that precedes the other. Analogous to the standard min(). The logic here is equivalent to the step "(int) (x - y)" where x and y are 32-bit unsigned int variables in TransactionIdPrecedes() in transam.c. """ diff = x - y if diff >= 2**31: ret = x elif diff > 0: ret = y elif diff > -2**31: ret = x else: # diff <= -2**31 ret = y return ret @unittest.skipIf(gpplatform.get_info()=="SOL", "Skipping Solaris, cannot compile xidhelper.so") class XidlimitsTests(MPPTestCase): """ @description Xidlimits Tests @created 2013-02-12 00:00:00 @modified 2013-02-12 00:00:00 @tags vacuum xidlimits echo @gucs gp_create_table_random_default_distribution=off """ # Constants identifying the limit to exceed. WARN_LIMIT = 0 STOP_LIMIT = 1 WRAP_LIMIT = 2 def setUp(self):
import unittest2 as unittest import tinctest.lib.gpplatform as gpplatform platforms = ["OSX", "SUSE", "RHEL5", "RHEL6", "SOL"] class PlatformTestCase(unittest.TestCase): def test_platform_get_info(self): platforms = ["OSX", "SUSE", "RHEL5", "RHEL6", "SOL"] for platform in platforms: check = gpplatform.get_info() == platform if check: self.assertTrue(check) def checkTrue(self, check): if check: self.assertTrue(check) else: self.assertFalse(check) for platform in platforms: def check_platform(platform): return lambda self: self.checkTrue(gpplatform.get_info() == platform) setattr( PlatformTestCase, "test_platform%r_%s" % (platform, gpplatform.get_info() == platform), check_platform(platform))