| 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")] |
no outgoing calls