MCPcopy Create free account
hub / github.com/KDE/labplot / testFullTablePrepend

Method testFullTablePrepend

tests/import_export/SQL/ImportSqlDatabaseTest.cpp:96–122  ·  view source on GitHub ↗

! * read the full table import in the prepand mode */

Source from the content-addressed store, hash-verified

94 * read the full table import in the prepand mode
95 */
96void ImportSqlDatabaseTest::testFullTablePrepend() {
97 // prepare the target spreadsheet
98 Spreadsheet spreadsheet(QStringLiteral("test"), false);
99 spreadsheet.setColumnCount(1);
100 spreadsheet.column(0)->setName(QStringLiteral("test"));
101 spreadsheet.column(0)->setColumnMode(AbstractColumn::ColumnMode::Double);
102
103 // import the first table "artists"
104 ImportSQLDatabaseWidget w;
105 w.loadSettings();
106 w.setCustomQuery(false);
107 w.read(&spreadsheet, AbstractFileFilter::ImportMode::Prepend);
108
109 // check the spreadsheet size and columns names and modes
110 QCOMPARE(spreadsheet.rowCount(), 347);
111 QCOMPARE(spreadsheet.columnCount(), 4);
112
113 QCOMPARE(spreadsheet.column(0)->name(), QLatin1String("AlbumId"));
114 QCOMPARE(spreadsheet.column(1)->name(), QLatin1String("Title"));
115 QCOMPARE(spreadsheet.column(2)->name(), QLatin1String("ArtistId"));
116 QCOMPARE(spreadsheet.column(3)->name(), QLatin1String("test"));
117
118 QCOMPARE(spreadsheet.column(0)->columnMode(), AbstractColumn::ColumnMode::Integer);
119 QCOMPARE(spreadsheet.column(1)->columnMode(), AbstractColumn::ColumnMode::Text);
120 QCOMPARE(spreadsheet.column(2)->columnMode(), AbstractColumn::ColumnMode::Integer);
121 QCOMPARE(spreadsheet.column(3)->columnMode(), AbstractColumn::ColumnMode::Double);
122}
123
124void ImportSqlDatabaseTest::testFullTableCustomRowRange() {
125 // prepare the target spreadsheet

Callers

nothing calls this directly

Calls 11

setCustomQueryMethod · 0.80
setColumnCountMethod · 0.45
setNameMethod · 0.45
columnMethod · 0.45
setColumnModeMethod · 0.45
loadSettingsMethod · 0.45
readMethod · 0.45
rowCountMethod · 0.45
columnCountMethod · 0.45
nameMethod · 0.45
columnModeMethod · 0.45

Tested by

no test coverage detected