MCPcopy Create free account
hub / github.com/dbcli/mycli / test_favorite_query_multiple_statement

Function test_favorite_query_multiple_statement

test/pytests/test_sqlexecute.py:213–245  ·  view source on GitHub ↗
(executor, monkeypatch)

Source from the content-addressed store, hash-verified

211@dbtest
212@pytest.mark.skipif(os.name == "nt", reason="Bug: fails on Windows, needs fixing, singleton of FQ not working right")
213def test_favorite_query_multiple_statement(executor, monkeypatch):
214 monkeypatch.setattr(iocommands.FavoriteQueries, 'instance', iocommands.favoritequeries, raising=False)
215 set_expanded_output(False)
216 run(executor, "create table test(a text)")
217 run(executor, "insert into test values('abc')")
218 run(executor, "insert into test values('def')")
219
220 results = run(executor, "\\fs test-ad select * from test where a like 'a%'; select * from test where a like 'd%'")
221 assert_result_equal(results, status="Saved.", status_plain="Saved.")
222
223 results = run(executor, "\\f test-ad")
224 expected = [
225 {
226 "preamble": "> select * from test where a like 'a%'",
227 "header": ["a"],
228 "rows": [("abc",)],
229 "postamble": None,
230 "status": None,
231 "status_plain": None,
232 },
233 {
234 "preamble": "> select * from test where a like 'd%'",
235 "header": ["a"],
236 "rows": [("def",)],
237 "postamble": None,
238 "status": None,
239 "status_plain": None,
240 },
241 ]
242 assert expected == results
243
244 results = run(executor, "\\fd test-ad")
245 assert_result_equal(results, status="test-ad: Deleted.", status_plain="test-ad: Deleted.")
246
247
248@dbtest

Callers

nothing calls this directly

Calls 3

set_expanded_outputFunction · 0.90
runFunction · 0.90
assert_result_equalFunction · 0.85

Tested by

no test coverage detected