示例#1
0
 def test_get_col_sizes1(self):
     result = ui._get_col_sizes(
         two_abc_rows,
         0,
         row_count=2,
         header_sizes=ui._get_header_entry_sizes(abc_schema, False),
         formatters=[ui.identity for i in xrange(len(abc_schema))])
     expected = [1, 16, 32]
     self.assertEquals(expected, result)
示例#2
0
    def go_get_num_cols(self, width, expected):
        result = ui._get_col_sizes(two_abc_rows, 0, row_count=2, header_sizes=ui._get_header_entry_sizes(abc_schema, False), formatters=[ui.identity for i in xrange(len(abc_schema))])

        def get_splits(width):
            num_cols_0 = ui._get_num_cols(abc_schema, width, 0, result, 0)
            num_cols_1 = ui._get_num_cols(abc_schema, width, num_cols_0, result, 0)
            num_cols_2 = ui._get_num_cols(abc_schema, width, num_cols_0 + num_cols_1, result, 0)
            return num_cols_0, num_cols_1, num_cols_2

        self.assertEquals(expected, get_splits(width))
    def go_get_num_cols(self, width, expected):
        result = ui._get_col_sizes(two_abc_rows, 0, row_count=2, header_sizes=ui._get_header_entry_sizes(abc_schema, False), formatters=[ui.identity for i in xrange(len(abc_schema))])

        def get_splits(width):
            num_cols_0 = ui._get_num_cols(abc_schema, width, 0, result, 0)
            num_cols_1 = ui._get_num_cols(abc_schema, width, num_cols_0, result, 0)
            num_cols_2 = ui._get_num_cols(abc_schema, width, num_cols_0 + num_cols_1, result, 0)
            return num_cols_0, num_cols_1, num_cols_2

        self.assertEquals(expected, get_splits(width))
示例#4
0
 def test_get_col_sizes1(self):
     result = ui._get_col_sizes(
         two_abc_rows,
         0,
         row_count=2,
         header_sizes=ui._get_header_entry_sizes(abc_schema, False),
         formatters=[ui.identity for i in xrange(len(abc_schema))],
     )
     expected = [1, 16, 32]
     self.assertEquals(expected, result)