X-Git-Url: https://git.jsancho.org/?p=datasette-connectors.git;a=blobdiff_plain;f=tests%2Fdummy.py;fp=tests%2Fdummy.py;h=feadf0a2e1ed2e81c1e703769b5225149a391650;hp=b4ae1c097da4c9e200f59cea33d316eb0703b968;hb=52416a749fac092a032a8b5239e477dd68180dfa;hpb=1a34f766bbcada99da81fabdc93b802e4ff8fb2a diff --git a/tests/dummy.py b/tests/dummy.py index b4ae1c0..feadf0a 100644 --- a/tests/dummy.py +++ b/tests/dummy.py @@ -1,7 +1,32 @@ from datasette_connectors.row import Row +from datasette_connectors.connectors import Connector -_connector_type = 'dummy' +class DummyConnector(Connector): + _connector_type = 'dummy' + + @staticmethod + def table_names(path): + return ['table1', 'table2'] + + @staticmethod + def table_columns(path, table): + return ['c1', 'c2', 'c3'] + + @staticmethod + def get_all_foreign_keys(path): + return { + 'table1': {'incoming': [], 'outgoing': []}, + 'table2': {'incoming': [], 'outgoing': []}, + } + + @staticmethod + def table_counts(path, *args, **kwargs): + return { + 'table1': 2, + 'table2': 2, + } + def inspect(path): tables = {}