Commit 80389eea authored by Laurent Montel's avatar Laurent Montel 😁
Browse files

Exclude path

parent 10b7de9a
...@@ -81,6 +81,7 @@ void ImportAddressbookJobInterfaceTest::importAddressbookConfig() ...@@ -81,6 +81,7 @@ void ImportAddressbookJobInterfaceTest::importAddressbookConfig()
TestImportFile *file = new TestImportFile(zipFilePath + testPath, this); TestImportFile *file = new TestImportFile(zipFilePath + testPath, this);
file->setPathConfig(zipFilePath + testPath); file->setPathConfig(zipFilePath + testPath);
file->setExtractPath(QDir::tempPath() + testPath); file->setExtractPath(QDir::tempPath() + testPath);
file->setExcludePath(Utils::addressbookPath());
ImportAddressbookJobInterfaceTestImpl *impl = new ImportAddressbookJobInterfaceTestImpl(this, {Utils::StoredType::Config}, file->archiveStorage(), 1); ImportAddressbookJobInterfaceTestImpl *impl = new ImportAddressbookJobInterfaceTestImpl(this, {Utils::StoredType::Config}, file->archiveStorage(), 1);
file->setAbstractImportExportJob(impl); file->setAbstractImportExportJob(impl);
file->start(); file->start();
......
...@@ -66,7 +66,7 @@ ImportAlarmJobInterfaceTest::ImportAlarmJobInterfaceTest(QObject *parent) ...@@ -66,7 +66,7 @@ ImportAlarmJobInterfaceTest::ImportAlarmJobInterfaceTest(QObject *parent)
{ {
} }
void ImportAlarmJobInterfaceTest::importCalendarConfig_data() void ImportAlarmJobInterfaceTest::importAlarmConfig_data()
{ {
QTest::addColumn<QString>("zipFilePath"); QTest::addColumn<QString>("zipFilePath");
QTest::addColumn<QString>("testPath"); QTest::addColumn<QString>("testPath");
...@@ -74,12 +74,13 @@ void ImportAlarmJobInterfaceTest::importCalendarConfig_data() ...@@ -74,12 +74,13 @@ void ImportAlarmJobInterfaceTest::importCalendarConfig_data()
QTest::newRow("test1") << QString::fromLatin1(pathConfig) << QStringLiteral("/test1/"); QTest::newRow("test1") << QString::fromLatin1(pathConfig) << QStringLiteral("/test1/");
} }
void ImportAlarmJobInterfaceTest::importCalendarConfig() void ImportAlarmJobInterfaceTest::importAlarmConfig()
{ {
QFETCH(QString, zipFilePath); QFETCH(QString, zipFilePath);
QFETCH(QString, testPath); QFETCH(QString, testPath);
TestImportFile *file = new TestImportFile(zipFilePath + testPath, this); TestImportFile *file = new TestImportFile(zipFilePath + testPath, this);
file->setPathConfig(zipFilePath + testPath); file->setPathConfig(zipFilePath + testPath);
file->setExcludePath(Utils::alarmPath());
file->setExtractPath(QDir::tempPath() + testPath); file->setExtractPath(QDir::tempPath() + testPath);
ImportAlarmJobInterfaceTestImpl *impl = new ImportAlarmJobInterfaceTestImpl(this, {Utils::StoredType::Config}, file->archiveStorage(), 1); ImportAlarmJobInterfaceTestImpl *impl = new ImportAlarmJobInterfaceTestImpl(this, {Utils::StoredType::Config}, file->archiveStorage(), 1);
file->setAbstractImportExportJob(impl); file->setAbstractImportExportJob(impl);
......
...@@ -46,8 +46,8 @@ public: ...@@ -46,8 +46,8 @@ public:
explicit ImportAlarmJobInterfaceTest(QObject *parent = nullptr); explicit ImportAlarmJobInterfaceTest(QObject *parent = nullptr);
~ImportAlarmJobInterfaceTest() = default; ~ImportAlarmJobInterfaceTest() = default;
private Q_SLOTS: private Q_SLOTS:
void importCalendarConfig(); void importAlarmConfig();
void importCalendarConfig_data(); void importAlarmConfig_data();
}; };
#endif // IMPORTALARMJOBINTERFACETEST_H #endif // IMPORTALARMJOBINTERFACETEST_H
...@@ -81,6 +81,7 @@ void ImportCalendarJobInterfaceTest::importCalendarConfig() ...@@ -81,6 +81,7 @@ void ImportCalendarJobInterfaceTest::importCalendarConfig()
TestImportFile *file = new TestImportFile(zipFilePath + testPath, this); TestImportFile *file = new TestImportFile(zipFilePath + testPath, this);
file->setPathConfig(zipFilePath + testPath); file->setPathConfig(zipFilePath + testPath);
file->setExtractPath(QDir::tempPath() + testPath); file->setExtractPath(QDir::tempPath() + testPath);
file->setExcludePath(Utils::calendarPath());
ImportCalendarJobInterfaceTestImpl *impl = new ImportCalendarJobInterfaceTestImpl(this, {Utils::StoredType::Config}, file->archiveStorage(), 1); ImportCalendarJobInterfaceTestImpl *impl = new ImportCalendarJobInterfaceTestImpl(this, {Utils::StoredType::Config}, file->archiveStorage(), 1);
file->setAbstractImportExportJob(impl); file->setAbstractImportExportJob(impl);
file->start(); file->start();
......
...@@ -50,6 +50,7 @@ void CompareImportFile::compareFile() ...@@ -50,6 +50,7 @@ void CompareImportFile::compareFile()
if (file == QLatin1String("information/exportdatatype.xml") || file == QLatin1String("information/VERSION_2")) { if (file == QLatin1String("information/exportdatatype.xml") || file == QLatin1String("information/VERSION_2")) {
continue; continue;
} }
//Allow to remove some file from resources path
if (file.startsWith(mExcludePath)) { if (file.startsWith(mExcludePath)) {
continue; continue;
} }
......
...@@ -91,6 +91,7 @@ void ImportMailJobInterfaceTest::importMailConfig() ...@@ -91,6 +91,7 @@ void ImportMailJobInterfaceTest::importMailConfig()
TestImportFile *file = new TestImportFile(zipFilePath + testPath, this); TestImportFile *file = new TestImportFile(zipFilePath + testPath, this);
file->setPathConfig(zipFilePath + testPath); file->setPathConfig(zipFilePath + testPath);
file->setExtractPath(QDir::tempPath() + testPath); file->setExtractPath(QDir::tempPath() + testPath);
file->setExcludePath(Utils::mailsPath()); // ???
ImportMailJobInterfaceTestImpl *impl = new ImportMailJobInterfaceTestImpl(this, {Utils::StoredType::Config}, file->archiveStorage(), 1); ImportMailJobInterfaceTestImpl *impl = new ImportMailJobInterfaceTestImpl(this, {Utils::StoredType::Config}, file->archiveStorage(), 1);
file->setAbstractImportExportJob(impl); file->setAbstractImportExportJob(impl);
file->start(); file->start();
......
...@@ -83,7 +83,7 @@ void ImportNotesJobInterfaceTest::importNoteConfig() ...@@ -83,7 +83,7 @@ void ImportNotesJobInterfaceTest::importNoteConfig()
TestImportFile *file = new TestImportFile(zipFilePath + testPath, this); TestImportFile *file = new TestImportFile(zipFilePath + testPath, this);
file->setPathConfig(zipFilePath + testPath); file->setPathConfig(zipFilePath + testPath);
file->setExtractPath(QDir::tempPath() + testPath); file->setExtractPath(QDir::tempPath() + testPath);
file->setExcludePath(QStringLiteral("note/")); file->setExcludePath(Utils::notePath());
ImportNotesJobInterfaceTestImpl *impl = new ImportNotesJobInterfaceTestImpl(this, {Utils::StoredType::Config}, file->archiveStorage(), 1); ImportNotesJobInterfaceTestImpl *impl = new ImportNotesJobInterfaceTestImpl(this, {Utils::StoredType::Config}, file->archiveStorage(), 1);
file->setAbstractImportExportJob(impl); file->setAbstractImportExportJob(impl);
file->start(); file->start();
...@@ -106,6 +106,7 @@ void ImportNotesJobInterfaceTest::importNoteConfigAndResources() ...@@ -106,6 +106,7 @@ void ImportNotesJobInterfaceTest::importNoteConfigAndResources()
TestImportFile *file = new TestImportFile(zipFilePath + testPath, this); TestImportFile *file = new TestImportFile(zipFilePath + testPath, this);
file->setPathConfig(zipFilePath + testPath); file->setPathConfig(zipFilePath + testPath);
file->setExtractPath(QDir::tempPath() + testPath); file->setExtractPath(QDir::tempPath() + testPath);
file->setExcludePath(Utils::notePath());
ImportNotesJobInterfaceTestImpl *impl = new ImportNotesJobInterfaceTestImpl(this, {Utils::StoredType::Config|Utils::StoredType::Resources}, file->archiveStorage(), 1); ImportNotesJobInterfaceTestImpl *impl = new ImportNotesJobInterfaceTestImpl(this, {Utils::StoredType::Config|Utils::StoredType::Resources}, file->archiveStorage(), 1);
file->setAbstractImportExportJob(impl); file->setAbstractImportExportJob(impl);
file->start(); file->start();
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment