feat: more work on python scriptiong basics

This commit is contained in:
2026-02-23 11:45:13 +01:00
parent 94b7ca2c80
commit caa3f3c061
18 changed files with 752 additions and 33 deletions

View File

@@ -0,0 +1,30 @@
import { describe, expect, it } from 'vitest';
import { createMacroRenderOptions } from '../../../src/renderer/python/macroRenderOptions';
describe('createMacroRenderOptions', () => {
it('maps hook/source metadata into runtime macro options', () => {
const options = createMacroRenderOptions({
hook: 'preview:macro',
source: {
kind: 'post',
id: 'post-5',
},
cacheKey: 'script-1:1:abc',
timeoutMs: 4000,
});
expect(options).toEqual({
macroHook: 'preview:macro',
macroSource: {
kind: 'post',
id: 'post-5',
},
cacheKey: 'script-1:1:abc',
timeoutMs: 4000,
});
});
it('returns empty options when no values are provided', () => {
expect(createMacroRenderOptions()).toEqual({});
});
});