MCPcopy Index your code
hub / github.com/dbcli/mycli / FakeCursor

Class FakeCursor

test/pytests/test_tabular_output.py:32–53  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

30 header = ["letters", "number", "optional", "float", "binary"]
31
32 class FakeCursor:
33 def __init__(self):
34 self.data = [("abc", 1, None, 10.0, b"\xaa"), ("d", 456, "1", 0.5, b"\xaa\xbb")]
35 self.description = [
36 (None, FIELD_TYPE.VARCHAR),
37 (None, FIELD_TYPE.LONG),
38 (None, FIELD_TYPE.LONG),
39 (None, FIELD_TYPE.FLOAT),
40 (None, FIELD_TYPE.BLOB),
41 ]
42
43 def __iter__(self):
44 return self
45
46 def __next__(self):
47 if self.data:
48 return self.data.pop(0)
49 else:
50 raise StopIteration()
51
52 def description(self):
53 return self.description
54
55 # Test sql-update output format
56 assert list(mycli.change_table_format("sql-update")) == [SQLResult(status="Changed table format to sql-update")]

Callers 2

test_sql_outputFunction · 0.70
test_postamble_outputFunction · 0.70

Calls

no outgoing calls

Tested by 2

test_sql_outputFunction · 0.56
test_postamble_outputFunction · 0.56