| 123 | } |
| 124 | |
| 125 | void TestProjectFile::getAddonFilePath() const |
| 126 | { |
| 127 | QTemporaryDir tempdir; |
| 128 | QVERIFY(tempdir.isValid()); |
| 129 | const QString filepath(tempdir.path() + "/addon.py"); |
| 130 | |
| 131 | QFile file(filepath); |
| 132 | QVERIFY(file.open(QIODevice::WriteOnly | QIODevice::Text)); |
| 133 | file.close(); |
| 134 | |
| 135 | // Relative path to addon |
| 136 | QCOMPARE(ProjectFile::getAddonFilePath(tempdir.path(), "addon"), filepath); |
| 137 | QCOMPARE(ProjectFile::getAddonFilePath(tempdir.path(), "not exist"), QString()); |
| 138 | |
| 139 | // Absolute path to addon |
| 140 | QCOMPARE(ProjectFile::getAddonFilePath("/not/exist", filepath), filepath); |
| 141 | QCOMPARE(ProjectFile::getAddonFilePath(tempdir.path(), filepath), filepath); |
| 142 | } |
| 143 | |
| 144 | void TestProjectFile::getSearchPaths() const |
| 145 | { |