Old Python new unitTest

Die alte Datei neu mit UnitTest überprüfen
This commit is contained in:
chk
2026-05-24 22:32:19 +02:00
parent 8d50b9801e
commit 1534170b7f
9 changed files with 83 additions and 13 deletions

View File

@@ -0,0 +1,32 @@
const { execSync } = require('child_process');
const fs = require('fs');
const path = require('path');
const BASE_PATH = path.join(__dirname, '..');
const PYTHON_CMD = process.platform === 'win32' ? 'python' : 'python3';
describe('Camera Pose Script', () => {
test('should build scene JSON with timestamp parameter', () => {
const outDir = "test/data/screenShots";
const strFile0 = path.join(outDir, "snapshot_video0_1778819665744.jpg");
const strFile1 = path.join(outDir, "snapshot_video1_1778819665744.jpg");
const command2 = `${PYTHON_CMD} ${path.join(BASE_PATH, 'programs/readTwoImages.py')} \
-i ${strFile0} \
-i ${strFile1} \
-npz ${path.join(BASE_PATH, 'data/settings/callibration_cam0.npz')} \
-npz ${path.join(BASE_PATH, 'data/settings/callibration_cam1.npz')} \
-settings ${path.join(BASE_PATH, 'data/settings/settings1m.json')}`;
try {
execSync(command2, { stdio: 'inherit' });
} catch (error) {
fail(`Failed to execute command: ${error.message}`);
}
});
});