Skip to content

Commit

Permalink
Flake8
Browse files Browse the repository at this point in the history
  • Loading branch information
MattFisher committed Dec 20, 2021
1 parent 2126c44 commit 72dbbf3
Showing 1 changed file with 28 additions and 6 deletions.
34 changes: 28 additions & 6 deletions tests/test_redshift_backend.py
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,8 @@ class IntrospectionTest(unittest.TestCase):
u'''SELECT
c2.relname,
idx.indrelid,
idx.indkey, -- indkey is of type "int2vector" and returns a space-separated string
idx.indkey,
-- indkey is of type "int2vector" and returns a space-separated string
idx.indisunique,
idx.indisprimary
FROM
Expand All @@ -219,9 +220,13 @@ def test_get_table_description_does_not_use_unsupported_functions(self):
from testapp.models import TestModel
table_name = TestModel._meta.db_table

_table_description = conn.introspection.get_table_description(mock_cursor, table_name)
_ = conn.introspection.get_table_description(mock_cursor, table_name)

(select_metadata_call, fetchall_call, select_row_call) = mock_cursor.method_calls
(
select_metadata_call,
fetchall_call,
select_row_call
) = mock_cursor.method_calls

call_method, call_args, call_kwargs = select_metadata_call
self.assertEqual('execute', call_method)
Expand All @@ -247,7 +252,15 @@ def test_get_get_constraints_does_not_use_unsupported_functions(self):

mock_cursor.fetchall.side_effect = [
# conname, conkey, conrelid, contype, used_cols)
[('testapp_testmodel_testapp_testmodel_id_pkey', [1], 12345678, 'p', None)],
[
(
'testapp_testmodel_testapp_testmodel_id_pkey',
[1],
12345678,
'p',
None,
),
],
[
# attrelid, attnum, attname
(12345678, 1, 'id'),
Expand All @@ -256,10 +269,19 @@ def test_get_get_constraints_does_not_use_unsupported_functions(self):
(12345678, 4, 'uuid'),
],
# index_name, indrelid, indkey, unique, primary
[('testapp_testmodel_testapp_testmodel_id_pkey', 12345678, '1', True, True)],
[
(
'testapp_testmodel_testapp_testmodel_id_pkey',
12345678,
'1',
True,
True,
),
],
]

table_constraints = conn.introspection.get_constraints(mock_cursor, table_name)
table_constraints = conn.introspection.get_constraints(
mock_cursor, table_name)

expected_table_constraints = {
'testapp_testmodel_testapp_testmodel_id_pkey': {
Expand Down

0 comments on commit 72dbbf3

Please sign in to comment.