diff --git a/tests/graphai/test_source_prop.ts b/tests/graphai/test_source_prop.ts index 3f301c517..dad9813c4 100644 --- a/tests/graphai/test_source_prop.ts +++ b/tests/graphai/test_source_prop.ts @@ -6,18 +6,18 @@ import test from "node:test"; import assert from "node:assert"; const graphData = { - version: 0.2, + version: 0.3, nodes: { input: { agent: "testAgent", }, test: { agent: "testAgent", - inputs: ["input"], + inputs: [":input"], }, test2: { agent: "testAgent", - inputs: ["test.hoge"], + inputs: [":test.hoge"], }, }, }; @@ -31,7 +31,7 @@ test("test source props test", async () => { }); const graphData_literal = { - version: 0.2, + version: 0.3, nodes: { source: { value: "apple", @@ -44,12 +44,12 @@ const graphData_literal = { params: { template: "${0}, ${1}, ${2}.", }, - inputs: ["source", "\"orange\"", undefined], + inputs: [":source", "orange", undefined], isResult: true, }, step2: { agent: "sleeperAgent", - inputs: ["source2", { lemon: "yellow" }], + inputs: [":source2", { lemon: "yellow" }], isResult: true, }, }, diff --git a/tests/graphai/test_validator_graph_data.ts b/tests/graphai/test_validator_graph_data.ts index 2fc11e517..a4100448c 100644 --- a/tests/graphai/test_validator_graph_data.ts +++ b/tests/graphai/test_validator_graph_data.ts @@ -15,7 +15,7 @@ const nodes = { // loop test test("test loop error", async () => { const graphdata = { - version: 0.2, + version: 0.3, loop: {}, nodes, }; @@ -25,7 +25,7 @@ test("test loop error", async () => { test("test loop error 1", async () => { const graphdata = { - version: 0.2, + version: 0.3, loop: { count: 1, while: "123", @@ -38,7 +38,7 @@ test("test loop error 1", async () => { // concurrency test test("test concurrency error zero", async () => { const graphdata = { - version: 0.2, + version: 0.3, concurrency: 0, nodes, }; @@ -47,7 +47,7 @@ test("test concurrency error zero", async () => { test("test concurrency error nagative", async () => { const graphdata = { - version: 0.2, + version: 0.3, concurrency: -1, nodes, }; @@ -56,7 +56,7 @@ test("test concurrency error nagative", async () => { test("test concurrency error float", async () => { const graphdata = { - version: 0.2, + version: 0.3, concurrency: 0.1, nodes, }; @@ -65,7 +65,7 @@ test("test concurrency error float", async () => { test("test concurrency error string", async () => { const graphdata = anonymization({ - version: 0.2, + version: 0.3, concurrency: "1", nodes, }); diff --git a/tests/units/graph_data.ts b/tests/units/graph_data.ts index c19e9e45d..66be0ce30 100644 --- a/tests/units/graph_data.ts +++ b/tests/units/graph_data.ts @@ -1,5 +1,5 @@ export const graph_data = { - version: 0.2, + version: 0.3, nodes: { echo: { agent: "echoAgent", @@ -9,28 +9,28 @@ export const graph_data = { }, bypassAgent: { agent: "bypassAgent", - inputs: ["echo"], + inputs: [":echo"], }, bypassAgent2: { agent: "bypassAgent", - inputs: ["bypassAgent"], + inputs: [":bypassAgent"], }, }, }; export const graph_injection_data = { - version: 0.2, + version: 0.3, nodes: { echo: { agent: "echoAgent", }, bypassAgent: { agent: "injectAgent", - inputs: ["echo"], + inputs: [":echo"], }, bypassAgent2: { agent: "bypassAgent", - inputs: ["bypassAgent"], + inputs: [":bypassAgent"], }, }, }; diff --git a/tests/units/test_utils.ts b/tests/units/test_utils.ts index 56bcc1bcc..76653240b 100644 --- a/tests/units/test_utils.ts +++ b/tests/units/test_utils.ts @@ -4,51 +4,51 @@ import test from "node:test"; import assert from "node:assert"; test("test getDataFromSource", async () => { - const inputId = "node1"; + const inputId = ":node1"; const result = { data: "123" }; const data = { data: "123" }; - const source = parseNodeName(inputId, 0.2); + const source = parseNodeName(inputId, 0.3); const res = getDataFromSource(result, source); assert.deepStrictEqual(res, data); }); test("test getDataFromSource parseId", async () => { - const inputId = "node1.data"; + const inputId = ":node1.data"; const result = { data: "123" }; const data = "123"; - const source = parseNodeName(inputId, 0.2); + const source = parseNodeName(inputId, 0.3); const res = getDataFromSource(result, source); assert.deepStrictEqual(res, data); }); test("test getDataFromSource array", async () => { - const inputId = "node1"; + const inputId = ":node1"; const result = ["123"]; const data = ["123"]; - const source = parseNodeName(inputId, 0.2); + const source = parseNodeName(inputId, 0.3); const res = getDataFromSource(result, source); assert.deepStrictEqual(res, data); }); test("test getDataFromSource array $0", async () => { - const inputId = "node1.$0"; + const inputId = ":node1.$0"; const result = ["000", "111"]; const data = "000"; - const source = parseNodeName(inputId, 0.2); + const source = parseNodeName(inputId, 0.3); const res = getDataFromSource(result, source); assert.deepStrictEqual(res, data); }); test("test getDataFromSource array $1", async () => { - const inputId = "node1.$1"; + const inputId = ":node1.$1"; const result = ["000", "111"]; const data = "111"; - const source = parseNodeName(inputId, 0.2); + const source = parseNodeName(inputId, 0.3); const res = getDataFromSource(result, source); assert.deepStrictEqual(res, data); }); @@ -56,31 +56,31 @@ test("test getDataFromSource array $1", async () => { // nested propId test("test getDataFromSource nested object", async () => { - const inputId = "node1.data.sample"; + const inputId = ":node1.data.sample"; const result = { data: { sample: "123" } }; const data = "123"; - const source = parseNodeName(inputId, 0.2); + const source = parseNodeName(inputId, 0.3); const res = getDataFromSource(result, source); assert.deepStrictEqual(res, data); }); test("test getDataFromSource nested array", async () => { - const inputId = "node1.data.sample.$2"; + const inputId = ":node1.data.sample.$2"; const result = { data: { sample: [0, 1, 2, 3] } }; const data = 2; - const source = parseNodeName(inputId, 0.2); + const source = parseNodeName(inputId, 0.3); const res = getDataFromSource(result, source); assert.deepStrictEqual(res, data); }); test("test getDataFromSource nested array last", async () => { - const inputId = "node1.data.sample.$last"; + const inputId = ":node1.data.sample.$last"; const result = { data: { sample: [0, 1, 2, 3] } }; const data = 3; - const source = parseNodeName(inputId, 0.2); + const source = parseNodeName(inputId, 0.3); const res = getDataFromSource(result, source); assert.deepStrictEqual(res, data); });