def test_write_regular_float(tmpdir):
    float_value = 1.0 / 3.0
    book = Workbook()
    sheet = book.get_active_sheet()
    sheet.cell("A1").value = float_value
    dest_filename = 'float_read_write_issue.xlsx'
    book.save(dest_filename)

    validate_archive(dest_filename)
    test_book = load_workbook(dest_filename)
    test_sheet = test_book.get_active_sheet()

    assert test_sheet.cell("A1").value == float_value
def test_write_regular_float(tmpdir):
    float_value = 1.0 / 3.0
    book = Workbook()
    sheet = book.get_active_sheet()
    sheet.cell("A1").value = float_value
    dest_filename = 'float_read_write_issue.xlsx'
    book.save(dest_filename)

    validate_archive(dest_filename)
    test_book = load_workbook(dest_filename)
    test_sheet = test_book.get_active_sheet()

    assert test_sheet.cell("A1").value == float_value
Esempio n. 3
0
def test_write_regular_float():

    float_value = 1.0 / 3.0
    book = Workbook()
    sheet = book.get_active_sheet()
    sheet.cell("A1").value = float_value
    dest_filename = os.path.join(TMPDIR, "float_read_write_issue.xlsx")
    book.save(dest_filename)

    validate_archive(dest_filename)
    test_book = load_workbook(dest_filename)
    test_sheet = test_book.get_active_sheet()

    eq_(test_sheet.cell("A1").value, float_value)
def test_write_regular_date(tmpdir):
    tmpdir.chdir()
    today = datetime.datetime(2010, 1, 18, 14, 15, 20, 1600)
    book = Workbook()
    sheet = book.get_active_sheet()
    sheet.cell("A1").value = today
    dest_filename = 'date_read_write_issue.xlsx'
    book.save(dest_filename)

    validate_archive(dest_filename)
    test_book = load_workbook(dest_filename)
    test_sheet = test_book.get_active_sheet()

    assert test_sheet.cell("A1").value == today
Esempio n. 5
0
def test_write_regular_float():

    float_value = 1.0 / 3.0
    book = Workbook()
    sheet = book.get_active_sheet()
    sheet.cell("A1").value = float_value
    dest_filename = os.path.join(TMPDIR, 'float_read_write_issue.xlsx')
    book.save(dest_filename)

    validate_archive(dest_filename)
    test_book = load_workbook(dest_filename)
    test_sheet = test_book.get_active_sheet()

    eq_(test_sheet.cell("A1").value, float_value)
Esempio n. 6
0
def test_write_regular_date():

    today = datetime.datetime(2010, 1, 18, 14, 15, 20, 1600)

    book = Workbook()
    sheet = book.get_active_sheet()
    sheet.cell("A1").value = today
    dest_filename = os.path.join(TMPDIR, "date_read_write_issue.xlsx")
    book.save(dest_filename)

    validate_archive(dest_filename)
    test_book = load_workbook(dest_filename)
    test_sheet = test_book.get_active_sheet()

    eq_(test_sheet.cell("A1").value, today)
Esempio n. 7
0
def test_write_regular_date():

    today = datetime.datetime(2010, 1, 18, 14, 15, 20, 1600)

    book = Workbook()
    sheet = book.get_active_sheet()
    sheet.cell("A1").value = today
    dest_filename = os.path.join(TMPDIR, 'date_read_write_issue.xlsx')
    book.save(dest_filename)

    validate_archive(dest_filename)
    test_book = load_workbook(dest_filename)
    test_sheet = test_book.get_active_sheet()

    eq_(test_sheet.cell("A1").value, today)