Skip to content

Commit

Permalink
lint
Browse files Browse the repository at this point in the history
  • Loading branch information
Inveracity committed Jul 26, 2023
1 parent fdd9292 commit 1d99a46
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
1 change: 1 addition & 0 deletions rethinkdb_mock/ast.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
9 changes: 6 additions & 3 deletions rethinkdb_mock/db.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down Expand Up @@ -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

Expand Down Expand Up @@ -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)):
Expand All @@ -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
Expand Down
1 change: 0 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
from setuptools import setup


setup(
name="rethinkdb_mock",
zip_safe=True,
Expand Down

0 comments on commit 1d99a46

Please sign in to comment.