1
0
mirror of https://github.com/bpatrik/pigallery2.git synced 2025-07-15 01:24:25 +02:00

implementing job history saving

This commit is contained in:
Patrik J. Braun
2019-12-29 00:35:41 +01:00
parent 47b1aa7b86
commit ddb734e64a
47 changed files with 479 additions and 316 deletions

View File

@ -63,7 +63,7 @@ export class SQLTestHelper {
await this.resetSQLite();
Config.Server.Database.type = ServerConfig.DatabaseType.sqlite;
Config.Server.Database.sqlite.storage = this.dbPath;
Config.Server.Database.dbFolder = path.dirname(this.dbPath);
}
private async initMySQL() {

View File

@ -32,7 +32,7 @@ describe('Typeorm integration', () => {
}
Config.Server.Database.type = ServerConfig.DatabaseType.sqlite;
Config.Server.Database.sqlite.storage = dbPath;
Config.Server.Database.dbFolder = path.dirname(dbPath);
};

View File

@ -16,15 +16,18 @@ describe('PhotoProcessing', () => {
const photoPath = path.join(ProjectPath.ImageFolder, 'test_png.png');
expect(await PhotoProcessing
.isValidConvertedPath(PhotoProcessing.generateConvertedFilePath(photoPath)))
.isValidConvertedPath(PhotoProcessing.generateConvertedPath(photoPath,
Config.Server.Media.Photo.Converting.resolution)))
.to.be.true;
expect(await PhotoProcessing
.isValidConvertedPath(PhotoProcessing.generateConvertedFilePath(photoPath + 'noPath')))
.isValidConvertedPath(PhotoProcessing.generateConvertedPath(photoPath + 'noPath',
Config.Server.Media.Photo.Converting.resolution)))
.to.be.false;
{
const convertedPath = PhotoProcessing.generateConvertedFilePath(photoPath);
const convertedPath = PhotoProcessing.generateConvertedPath(photoPath,
Config.Server.Media.Photo.Converting.resolution);
Config.Server.Media.Photo.Converting.resolution = <any>1;
expect(await PhotoProcessing.isValidConvertedPath(convertedPath)).to.be.false;
}
@ -42,18 +45,18 @@ describe('PhotoProcessing', () => {
for (let i = 0; i < Config.Client.Media.Thumbnail.thumbnailSizes.length; ++i) {
const thSize = Config.Client.Media.Thumbnail.thumbnailSizes[i];
expect(await PhotoProcessing
.isValidConvertedPath(PhotoProcessing.generateThumbnailPath(photoPath, thSize)))
.isValidConvertedPath(PhotoProcessing.generateConvertedPath(photoPath, thSize)))
.to.be.true;
expect(await PhotoProcessing
.isValidConvertedPath(PhotoProcessing.generateThumbnailPath(photoPath + 'noPath', thSize)))
.isValidConvertedPath(PhotoProcessing.generateConvertedPath(photoPath + 'noPath', thSize)))
.to.be.false;
}
expect(await PhotoProcessing
.isValidConvertedPath(PhotoProcessing.generateThumbnailPath(photoPath, 30)))
.isValidConvertedPath(PhotoProcessing.generateConvertedPath(photoPath, 30)))
.to.be.false;
});