Пример #1
0
def test_add_blank_line():
    blank_line = '\n'
    report = RstWriter(REPORT_FILE)
    report.add_blank_line()
    with open(REPORT_FILE, 'r') as rst:
        content = rst.read()
    print(content)
    assert content == blank_line
Пример #2
0
def test_table_with_floats_and_ints():
    csv = load_table('table4.csv')
    csv['COL1'] = csv['COL1'].astype(float)
    csv['COL5_'] = csv['COL5_'].astype(int)
    report = RstWriter(REPORT_FILE)
    report.table(csv)
    report.publish('html')
Пример #3
0
def test_table_thousands_separator():
    thousands = True
    csv = load_table('table4.csv')
    csv['COL1'] = csv['COL1'].astype(float)
    csv['COL5_'] = csv['COL5_'].astype(int)
    report = RstWriter(REPORT_FILE)
    report.table(csv, thousands=thousands)
    report.publish('html')
Пример #4
0
def test_table_comma_as_decimal():
    decimal = ','
    csv = load_table('table4.csv')
    csv['COL1'] = csv['COL1'].astype(float)
    csv['COL5_'] = csv['COL5_'].astype(int)
    report = RstWriter(REPORT_FILE)
    report.table(csv, decimal=decimal)
    report.publish('html')
Пример #5
0
def test_table_only_strings_diff_width_header_columns():
    csv = load_table('table3.csv')
    report = RstWriter(REPORT_FILE)
    report.table(csv)
    report.publish('html')
Пример #6
0
def test_table_only_strings_same_width():
    csv = load_table('table1.csv')
    report = RstWriter(REPORT_FILE)
    report.table(csv)
    report.publish('html')
Пример #7
0
def test_close_header_unindent():
    report = RstWriter(REPORT_FILE)
    report.header('close')
    assert report.indent == ''
Пример #8
0
def test_open_header_identation():
    report = RstWriter(REPORT_FILE)
    report.header('open')
    assert report.indent == '   '
Пример #9
0
def test_add_ccs_file(css):
    css_file = css
    report = RstWriter(REPORT_FILE)
    report.css = css_file
    assert report.css == css_file
Пример #10
0
def test_write_to_rst_from_string():
    foo_list = 'Test write to rst from string.'
    report = RstWriter(REPORT_FILE)
    assert report.write(foo_list) is True
Пример #11
0
def test_write_to_rst_from_list():
    foo_list = ['Test write to rst from list 1.\n',
                'Test write to rst from list 2.\n']
    report = RstWriter(REPORT_FILE)
    assert report.write(foo_list) is True
Пример #12
0
def test_create_rstwriter():
    report = RstWriter(REPORT_FILE)
    assert report.rstfile == REPORT_FILE