diff --git a/rethinkdb_mock/ast.py b/rethinkdb_mock/ast.py index cbc1f49..d2a479c 100644 --- a/rethinkdb_mock/ast.py +++ b/rethinkdb_mock/ast.py @@ -726,6 +726,7 @@ def __init__(self, *args, **kwargs): def run(self, arg, scope): return arg.list_dbs() + class TableListTL(RBase): def __init__(self, *args, **kwargs): pass diff --git a/rethinkdb_mock/db.py b/rethinkdb_mock/db.py index 268921f..fda454e 100644 --- a/rethinkdb_mock/db.py +++ b/rethinkdb_mock/db.py @@ -6,9 +6,10 @@ from . import rtime from . import util -from .rql_rewrite import rewrite_query, RQL_TYPE_TRANSLATIONS -from .scope import Scope from .ast_base import BinExp +from .rql_rewrite import rewrite_query +from .rql_rewrite import RQL_TYPE_TRANSLATIONS +from .scope import Scope def fill_missing_report_results(report): @@ -199,7 +200,7 @@ def set_table(self, table_name, new_table_instance): class MockDb(object): - def __init__(self, dbs_by_name, defaultDB = None): + def __init__(self, dbs_by_name, defaultDB=None): self.dbs_by_name = dbs_by_name self.defaultDB = defaultDB @@ -308,6 +309,7 @@ def objects_from_pods(data): return MockDb(dbs_by_name, defaultDB) + def set_default_db(query, name): if len(query._args) > 0: if not (query._args[0].__class__ in RQL_TYPE_TRANSLATIONS and issubclass(RQL_TYPE_TRANSLATIONS[query._args[0].__class__], BinExp)): @@ -320,6 +322,7 @@ def set_default_db(query, name): if query.__class__ in RQL_TYPE_TRANSLATIONS and issubclass(RQL_TYPE_TRANSLATIONS[query.__class__], BinExp): query._args = [rethinkdb.ast.DB(name)] + class MockThinkConn(object): def __init__(self, rethinkdb_mock_parent): self.rethinkdb_mock_parent = rethinkdb_mock_parent diff --git a/setup.py b/setup.py index 6ae6beb..a345b76 100644 --- a/setup.py +++ b/setup.py @@ -1,6 +1,5 @@ from setuptools import setup - setup( name="rethinkdb_mock", zip_safe=True,