Commit 3231c226 authored by Sandro Knauß's avatar Sandro Knauß 🐝
Browse files

MessageCore/AutocryptStorage: Add tests for creation of basepath.

parent 5bba9d0d
...@@ -142,3 +142,15 @@ void AutocryptStorageTest::test_deleteRecipient() ...@@ -142,3 +142,15 @@ void AutocryptStorageTest::test_deleteRecipient()
QCOMPARE(baseDir.exists(fileName), false); QCOMPARE(baseDir.exists(fileName), false);
QCOMPARE(storage->getRecipient(addr), nullptr); QCOMPARE(storage->getRecipient(addr), nullptr);
} }
void AutocryptStorageTest::test_create_basedir()
{
const QByteArray addr("recipient@autocrypt.example");
const QString fileName(QStringLiteral("recipient%40autocrypt.example.json"));
auto storage = AutocryptStorage::self();
QVERIFY(storage->addRecipient(addr));
baseDir.removeRecursively();
QCOMPARE(baseDir.exists(), false);
storage->save();
QCOMPARE(baseDir.exists(fileName), true);
}
...@@ -22,6 +22,7 @@ private Q_SLOTS: ...@@ -22,6 +22,7 @@ private Q_SLOTS:
void test_store(); void test_store();
void test_addRecipient(); void test_addRecipient();
void test_deleteRecipient(); void test_deleteRecipient();
void test_create_basedir();
private: private:
QDir baseDir; QDir baseDir;
}; };
......
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