MCPcopy
hub / github.com/openai/openai-python / test_removes_files_from_input

Function test_removes_files_from_input

tests/test_extract_files.py:11–26  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

9
10
11def test_removes_files_from_input() -> None:
12 query = {"foo": "bar"}
13 assert extract_files(query, paths=[]) == []
14 assert query == {"foo": "bar"}
15
16 query2 = {"foo": b"Bar", "hello": "world"}
17 assert extract_files(query2, paths=[["foo"]]) == [("foo", b"Bar")]
18 assert query2 == {"hello": "world"}
19
20 query3 = {"foo": {"foo": {"bar": b"Bar"}}, "hello": "world"}
21 assert extract_files(query3, paths=[["foo", "foo", "bar"]]) == [("foo[foo][bar]", b"Bar")]
22 assert query3 == {"foo": {"foo": {}}, "hello": "world"}
23
24 query4 = {"foo": {"bar": b"Bar", "baz": "foo"}, "hello": "world"}
25 assert extract_files(query4, paths=[["foo", "bar"]]) == [("foo[bar]", b"Bar")]
26 assert query4 == {"hello": "world", "foo": {"baz": "foo"}}
27
28
29def test_multiple_files() -> None:

Callers

nothing calls this directly

Calls 1

extract_filesFunction · 0.90

Tested by

no test coverage detected