def test_describe_partitioned_table_with_limit(self): # We have 2 partitions in the test table finish = BROWSE_PARTITIONED_TABLE_LIMIT.set_for_testing("1") try: response = self.client.get("/metastore/table/%s/test_partitions/partitions" % self.db_name) partition_values_json = json.loads(response.context['partition_values_json']) assert_equal(1, len(partition_values_json)) finally: finish() finish = BROWSE_PARTITIONED_TABLE_LIMIT.set_for_testing("3") try: response = self.client.get("/metastore/table/%s/test_partitions/partitions" % self.db_name) partition_values_json = json.loads(response.context['partition_values_json']) assert_equal(2, len(partition_values_json)) finally: finish()
def test_browse_partitioned_table_with_limit(self): # Limit to 90 finish = BROWSE_PARTITIONED_TABLE_LIMIT.set_for_testing("90") try: response = self.client.get("/metastore/table/default/test_partitions") assert_true("0x%x" % 89 in response.content, response.content) assert_false("0x%x" % 90 in response.content, response.content) finally: finish()
def test_describe_partitioned_table_with_limit(self): # Limit to 90 finish = BROWSE_PARTITIONED_TABLE_LIMIT.set_for_testing("90") try: response = self.client.get("/metastore/table/%s/test_partitions" % self.db_name) assert_true("0x%x" % 89 in response.content, response.content) assert_false("0x%x" % 90 in response.content, response.content) finally: finish()
def test_browse_partitions_with_limit(self): # Limit to 90 finish = BROWSE_PARTITIONED_TABLE_LIMIT.set_for_testing("90") try: response = self.client.get("/catalog/table/default/test_partitions") assert_true("0x%x" % 89 in response.content, response.content) assert_false("0x%x" % 90 in response.content, response.content) finally: finish()
def test_describe_partitioned_table_with_limit(self): if is_live_cluster(): raise SkipTest('HUE-2902: Test is not re-entrant') # Limit to 90 finish = BROWSE_PARTITIONED_TABLE_LIMIT.set_for_testing("90") try: response = self.client.get("/metastore/table/%s/test_partitions" % self.db_name) assert_true("0x%x" % 89 in response.content, response.content) assert_false("0x%x" % 90 in response.content, response.content) finally: finish()
def test_browse_limit_overrides_partition_limit(self): # Limit to 45 finish = [ BROWSE_TABLE_LIMIT.set_for_testing("45"), BROWSE_PARTITIONED_TABLE_LIMIT.set_for_testing("90"), ] try: response = self.client.get("/metastore/table/default/test_partitions") assert_true("0x%x" % 44 in response.content, response.content) assert_false("0x%x" % 45 in response.content, response.content) finally: for f in finish: f()