xlnt/tests/test_props.hpp

95 lines
3.0 KiB
C++
Raw Normal View History

2014-05-09 03:32:12 +08:00
#pragma once
#include <iostream>
#include <cxxtest/TestSuite.h>
2014-06-06 04:19:31 +08:00
#include <xlnt/xlnt.hpp>
2014-05-09 03:32:12 +08:00
2014-06-06 04:19:31 +08:00
class test_props : public CxxTest::TestSuite
2014-05-09 03:32:12 +08:00
{
public:
2014-05-13 01:42:28 +08:00
class TestReaderProps
{
void setup_class(int cls)
2014-05-13 01:42:28 +08:00
{
//cls.genuine_filename = os.path.join(DATADIR, "genuine", "empty.xlsx");
//cls.archive = ZipFile(cls.genuine_filename, "r", ZIP_DEFLATED);
2014-05-13 01:42:28 +08:00
}
void teardown_class(int cls)
2014-05-13 01:42:28 +08:00
{
//cls.archive.close();
2014-05-13 01:42:28 +08:00
}
};
2014-05-09 03:32:12 +08:00
void test_read_properties_core()
{
//content = archive.read(ARC_CORE)
// prop = read_properties_core(content)
// TS_ASSERT_EQUALS(prop.creator, "*.*")
// eacute = chr(233)
// TS_ASSERT_EQUALS(prop.last_modified_by, "Aur" + eacute + "lien Camp" + eacute + "as")
// TS_ASSERT_EQUALS(prop.created, datetime(2010, 4, 9, 20, 43, 12))
// TS_ASSERT_EQUALS(prop.modified, datetime(2011, 2, 9, 13, 49, 32))
2014-05-09 03:32:12 +08:00
}
void test_read_sheets_titles()
{
//content = archive.read(ARC_WORKBOOK);
//sheet_titles = read_sheets_titles(content);
//TS_ASSERT_EQUALS(sheet_titles, \
// ["Sheet1 - Text", "Sheet2 - Numbers", "Sheet3 - Formulas", "Sheet4 - Dates"]);
2014-05-09 03:32:12 +08:00
}
// Just tests that the correct date / time format is returned from LibreOffice saved version
2014-05-09 03:32:12 +08:00
void setup_class(int cls)
2014-05-13 01:42:28 +08:00
{
//cls.genuine_filename = os.path.join(DATADIR, "genuine", "empty_libre.xlsx")
// cls.archive = ZipFile(cls.genuine_filename, "r", ZIP_DEFLATED)
2014-05-13 01:42:28 +08:00
}
2014-05-09 03:32:12 +08:00
void teardown_class(int cls)
2014-05-13 01:42:28 +08:00
{
//cls.archive.close()
2014-05-13 01:42:28 +08:00
}
2014-05-09 03:32:12 +08:00
void test_read_properties_core2()
{
// content = archive.read(ARC_CORE)
// prop = read_properties_core(content)
// TS_ASSERT_EQUALS(prop.excel_base_date, CALENDAR_WINDOWS_1900)
2014-05-09 03:32:12 +08:00
}
void test_read_sheets_titles2()
{
//content = archive.read(ARC_WORKBOOK)
// sheet_titles = read_sheets_titles(content)
// TS_ASSERT_EQUALS(sheet_titles, \
// ["Sheet1 - Text", "Sheet2 - Numbers", "Sheet3 - Formulas", "Sheet4 - Dates"])
2014-05-13 01:42:28 +08:00
}
2014-05-09 03:32:12 +08:00
void test_write_properties_core()
{
//prop.creator = "TEST_USER"
// prop.last_modified_by = "SOMEBODY"
// prop.created = datetime(2010, 4, 1, 20, 30, 00)
// prop.modified = datetime(2010, 4, 5, 14, 5, 30)
// content = write_properties_core(prop)
// assert_equals_file_content(
// os.path.join(DATADIR, "writer", "expected", "core.xml"),
// content)
2014-05-09 03:32:12 +08:00
}
void test_write_properties_app()
{
//wb = Workbook()
// wb.create_sheet()
// wb.create_sheet()
// content = write_properties_app(wb)
// assert_equals_file_content(
// os.path.join(DATADIR, "writer", "expected", "app.xml"),
// content)
2014-05-09 03:32:12 +08:00
}
};