1
0
mirror of synced 2025-01-19 22:32:45 +01:00
bemaniutils/bemani/tests/helpers.py
Jennifer Taylor 509cb4f0d9 Convert most of the format() string calls to f-strings using libcst.
Exact commands run were:

  python3 -m libcst.tool codemod convert_format_to_fstring.ConvertFormatStringCommand . --no-format
  python3 setup.py build_ext --inplace
2020-01-07 21:29:07 +00:00

18 lines
486 B
Python

# vim: set fileencoding=utf-8
from typing import List, Dict, Any
class FakeCursor():
def __init__(self, rows: List[Dict[str, Any]]) -> None:
self.__rows = rows
self.rowcount = len(rows)
def fetchone(self) -> Dict[str, Any]:
if len(self.__rows) != 1:
raise Exception(f'Tried to fetch one row and there are {len(self.__rows)} rows!')
return self.__rows[0]
def fetchall(self) -> List[Dict[str, Any]]:
return self.__rows