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

Method testFullTableReplace

tests/import_export/SQL/ImportSqlDatabaseTest.cpp:39–60  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

37 * read the full table import in the replace mode
38 */
39void ImportSqlDatabaseTest::testFullTableReplace() {
40 // prepare the target spreadsheet
41 Spreadsheet spreadsheet(QStringLiteral("test"), false);
42
43 // import the first table "artists"
44 ImportSQLDatabaseWidget w;
45 w.loadSettings();
46 w.setCustomQuery(false);
47 w.read(&spreadsheet, AbstractFileFilter::ImportMode::Replace);
48
49 // check the spreadsheet size and columns names and modes
50 QCOMPARE(spreadsheet.rowCount(), 347);
51 QCOMPARE(spreadsheet.columnCount(), 3);
52
53 QCOMPARE(spreadsheet.column(0)->name(), QLatin1String("AlbumId"));
54 QCOMPARE(spreadsheet.column(1)->name(), QLatin1String("Title"));
55 QCOMPARE(spreadsheet.column(2)->name(), QLatin1String("ArtistId"));
56
57 QCOMPARE(spreadsheet.column(0)->columnMode(), AbstractColumn::ColumnMode::Integer);
58 QCOMPARE(spreadsheet.column(1)->columnMode(), AbstractColumn::ColumnMode::Text);
59 QCOMPARE(spreadsheet.column(2)->columnMode(), AbstractColumn::ColumnMode::Integer);
60}
61
62/*!
63 * read the full table import in the append mode

Callers

nothing calls this directly

Calls 8

setCustomQueryMethod · 0.80
loadSettingsMethod · 0.45
readMethod · 0.45
rowCountMethod · 0.45
columnCountMethod · 0.45
nameMethod · 0.45
columnMethod · 0.45
columnModeMethod · 0.45

Tested by

no test coverage detected