def testCreateTableNameEmpty(self): """ table名为空 """ jobHelper = JobHelper() jobHelper.append(jobHelper.rtidbClient.create_table, name='') retStatus = jobHelper.run(failonerror=False) self.assertFalse(retStatus)
def testScanPkInvalid(self): """ 不存在的partition_key进行scan """ jobHelper = JobHelper() jobHelper.append(jobHelper.rtidbClient.create_table) jobHelper.append(jobHelper.rtidbClient.put, pk='123') jobHelper.append(jobHelper.rtidbClient.scan, pk='456') retStatus = jobHelper.run(failonerror=False, autoidentity=False) self.assertTrue(retStatus) self.assertEqual(0, len(jobHelper.scanout_message()))
def testScanTidInvalid(self): """ table_id不存在的表进行scan """ jobHelper = JobHelper() jobHelper.append(jobHelper.rtidbClient.create_table, tid=123) jobHelper.append(jobHelper.rtidbClient.put, tid=123) jobHelper.append(jobHelper.rtidbClient.scan, tid=456) retStatus = jobHelper.run(autoidentity=False, logcheck=False) self.assertTrue(retStatus) self.assertEqual(0, len(jobHelper.scanout_message()))
def testScanEtimeEmpty(self): """ timestamp_end为空 """ jobHelper = JobHelper() jobHelper.append(jobHelper.rtidbClient.create_table) jobHelper.append(jobHelper.rtidbClient.put) jobHelper.append(jobHelper.rtidbClient.scan, etime=0) retStatus = jobHelper.run(failonerror=False, autoidentity=False) self.assertTrue(retStatus) self.assertEqual(1, len(jobHelper.scanout_message()))
def testCreateTablePid0(self): """ pid=0 """ jobHelper = JobHelper() jobHelper.append(jobHelper.rtidbClient.create_table, pid=0) jobHelper.append(jobHelper.rtidbClient.put) jobHelper.append(jobHelper.rtidbClient.scan) retStatus = jobHelper.run() self.assertTrue(retStatus)
def testScanCommon(self): """ scan操作,正确处理 """ jobHelper = JobHelper() jobHelper.append(jobHelper.rtidbClient.create_table) jobHelper.append(jobHelper.rtidbClient.put) jobHelper.append(jobHelper.rtidbClient.scan) retStatus = jobHelper.run() self.assertTrue(retStatus)
def testCreateTablePidMax(self): """ pid=max """ jobHelper = JobHelper() import sys jobHelper.append(jobHelper.rtidbClient.create_table, pid=sys.maxint) jobHelper.append(jobHelper.rtidbClient.put, pid=sys.maxint) jobHelper.append(jobHelper.rtidbClient.scan, pid=sys.maxint) retStatus = jobHelper.run() self.assertTrue(retStatus)
def testCreateTableSameToken(self): """ table名,table_id,partion_id,segment_count配相同数字 """ jobHelper = JobHelper() import sys jobHelper.append(jobHelper.rtidbClient.create_table, name='123', tid=123, pid=123) jobHelper.append(jobHelper.rtidbClient.put, tid=123, pid=123) jobHelper.append(jobHelper.rtidbClient.scan, tid=123, pid=123) retStatus = jobHelper.run() self.assertTrue(retStatus)
def testCreateTableNameDuplicate(self): """ 已经存在的table名,再次执行create操作失败 """ jobHelper = JobHelper() jobHelper.append(jobHelper.rtidbClient.create_table, name='table_duplacate') jobHelper.append(jobHelper.rtidbClient.create_table, name='table_duplacate') retStatus = jobHelper.run(failonerror=False) self.assertFalse(retStatus)