MCPcopy Create free account
hub / github.com/couchbase/sync_gateway / test_make_curl_task

Function test_make_curl_task

tools-tests/tasks_test.py:81–107  ·  view source on GitHub ↗
(tmpdir, httpserver)

Source from the content-addressed store, hash-verified

79
80
81def test_make_curl_task(tmpdir, httpserver):
82 output = "curltask"
83 httpserver.expect_request("/").respond_with_json(json.loads(INPUT_CONFIG))
84 task = tasks.make_curl_task(
85 "curltask",
86 httpserver.url_for("/"),
87 auth_headers={},
88 content_postprocessors=[
89 password_remover.remove_passwords,
90 password_remover.tag_userdata_in_server_config,
91 ],
92 log_file=output,
93 )
94
95 output_dir = tmpdir.mkdir("output")
96 runner = tasks.TaskRunner(
97 verbosity=VERBOSE,
98 default_name="sg.log",
99 tmp_dir=output_dir,
100 )
101 runner.run(task)
102 runner.close_all_files()
103
104 with open(pathlib.Path(runner.tmpdir) / output) as fh:
105 assert REDACTED_OUTPUT in fh.read()
106
107 httpserver.check()
108
109
110def test_task_print_literal(tmp_path):

Callers

nothing calls this directly

Calls 3

runMethod · 0.95
close_all_filesMethod · 0.95
readMethod · 0.80

Tested by

no test coverage detected