예제 #1
0
파일: test_xl.py 프로젝트: miketarpey/piper
def test_WorkBook_Sheet_add_format(sample_orders_01):
    ''' Not sure how I can 'test' add_format directly.
    '''
    df = sample_orders_01

    file_name = relative_folder / 'WorkBook - add_format.xlsx'
    wb = WorkBook(file_name, ts_prefix=False)

    ws = wb.add_sheet(df, sheet_name='original', tab_color='yellow', zoom=175)

    attr = {'column': 'D', 'format': 'center', 'width': 11}
    wb.add_format(ws, column_attr=attr)

    wb.close()
예제 #2
0
파일: test_xl.py 프로젝트: miketarpey/piper
def test_WorkBook_Sheet_add_formats(sample_orders_01):
    ''' Not sure how I can 'test' add_format directly.
    '''
    df = sample_orders_01

    file_name = relative_folder / 'WorkBook - add_formats.xlsx'
    wb = WorkBook(file_name, ts_prefix=False)

    ws = wb.add_sheet(df, sheet_name='original', tab_color='yellow', zoom=175)

    centre_cols = ['C', 'D', 'E']

    formats = []
    for col in centre_cols:
        attr = {'column': col, 'format': 'center', 'width': 11}
        formats.append(attr)

    wb.add_format(ws, column_attr=formats)

    wb.close()