mirror of
https://github.com/invoke-ai/InvokeAI
synced 2024-08-30 20:32:17 +00:00
fix(tests): fix tests
This commit is contained in:
parent
be6ba57775
commit
0c639bd751
@ -116,14 +116,14 @@ def test_graph_state_expands_iterator(mock_services):
|
|||||||
graph.add_node(AddInvocation(id="3", b=1))
|
graph.add_node(AddInvocation(id="3", b=1))
|
||||||
graph.add_edge(create_edge("0", "collection", "1", "collection"))
|
graph.add_edge(create_edge("0", "collection", "1", "collection"))
|
||||||
graph.add_edge(create_edge("1", "item", "2", "a"))
|
graph.add_edge(create_edge("1", "item", "2", "a"))
|
||||||
graph.add_edge(create_edge("2", "a", "3", "a"))
|
graph.add_edge(create_edge("2", "value", "3", "a"))
|
||||||
|
|
||||||
g = GraphExecutionState(graph=graph)
|
g = GraphExecutionState(graph=graph)
|
||||||
while not g.is_complete():
|
while not g.is_complete():
|
||||||
invoke_next(g, mock_services)
|
invoke_next(g, mock_services)
|
||||||
|
|
||||||
prepared_add_nodes = g.source_prepared_mapping["3"]
|
prepared_add_nodes = g.source_prepared_mapping["3"]
|
||||||
results = set([g.results[n].a for n in prepared_add_nodes])
|
results = set([g.results[n].value for n in prepared_add_nodes])
|
||||||
expected = set([1, 11, 21])
|
expected = set([1, 11, 21])
|
||||||
assert results == expected
|
assert results == expected
|
||||||
|
|
||||||
|
@ -477,13 +477,13 @@ def test_graph_expands_subgraph():
|
|||||||
n1_2 = SubtractInvocation(id="2", b=3)
|
n1_2 = SubtractInvocation(id="2", b=3)
|
||||||
n1.graph.add_node(n1_1)
|
n1.graph.add_node(n1_1)
|
||||||
n1.graph.add_node(n1_2)
|
n1.graph.add_node(n1_2)
|
||||||
n1.graph.add_edge(create_edge("1", "a", "2", "a"))
|
n1.graph.add_edge(create_edge("1", "value", "2", "a"))
|
||||||
|
|
||||||
g.add_node(n1)
|
g.add_node(n1)
|
||||||
|
|
||||||
n2 = AddInvocation(id="2", b=5)
|
n2 = AddInvocation(id="2", b=5)
|
||||||
g.add_node(n2)
|
g.add_node(n2)
|
||||||
g.add_edge(create_edge("1.2", "a", "2", "a"))
|
g.add_edge(create_edge("1.2", "value", "2", "a"))
|
||||||
|
|
||||||
dg = g.nx_graph_flat()
|
dg = g.nx_graph_flat()
|
||||||
assert set(dg.nodes) == set(["1.1", "1.2", "2"])
|
assert set(dg.nodes) == set(["1.1", "1.2", "2"])
|
||||||
@ -500,14 +500,14 @@ def test_graph_subgraph_t2i():
|
|||||||
|
|
||||||
g.add_node(n1)
|
g.add_node(n1)
|
||||||
|
|
||||||
n2 = IntegerInvocation(id="2", a=512)
|
n2 = IntegerInvocation(id="2", value=512)
|
||||||
n3 = IntegerInvocation(id="3", a=256)
|
n3 = IntegerInvocation(id="3", value=256)
|
||||||
|
|
||||||
g.add_node(n2)
|
g.add_node(n2)
|
||||||
g.add_node(n3)
|
g.add_node(n3)
|
||||||
|
|
||||||
g.add_edge(create_edge("2", "a", "1.width", "a"))
|
g.add_edge(create_edge("2", "value", "1.width", "value"))
|
||||||
g.add_edge(create_edge("3", "a", "1.height", "a"))
|
g.add_edge(create_edge("3", "value", "1.height", "value"))
|
||||||
|
|
||||||
n4 = ShowImageInvocation(id="4")
|
n4 = ShowImageInvocation(id="4")
|
||||||
g.add_node(n4)
|
g.add_node(n4)
|
||||||
|
Loading…
Reference in New Issue
Block a user