MCPcopy Index your code
hub / github.com/dbcli/pgcli / test_execute_from_file_io_error

Function test_execute_from_file_io_error

tests/test_pgexecute.py:288–298  ·  view source on GitHub ↗

r"""\i with an os_error returns an error.

(os, executor, pgspecial)

Source from the content-addressed store, hash-verified

286@dbtest
287@patch("pgcli.main.os")
288def test_execute_from_file_io_error(os, executor, pgspecial):
289 r"""\i with an os_error returns an error."""
290 # Inject an OSError.
291 os.path.expanduser.side_effect = OSError("test")
292
293 # Check the result.
294 result = list(executor.run(r"\i test", pgspecial=pgspecial))
295 status, sql, success, is_special = result[0][3:]
296 assert status == "test"
297 assert success is False
298 assert is_special is True
299
300
301@dbtest

Callers

nothing calls this directly

Calls 1

runMethod · 0.45

Tested by

no test coverage detected